1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
rusak2 [61]
4 years ago
8

Something is wrong with the logic in the program above. For which values of time will the greeting "Good Morning!" be displayed?

var time = promptNum("What hour is it (on a 24 hour clock)?"); var greeting = ""; if (time < 6) { greeting = "It is too early!"; } else if (time < 20) { greeting = "Good Day!"; } else if (time < 10) { greeting = "Good Morning!"; } else { greeting = "Good Evening!"; } console.log(greeting);
Computers and Technology
1 answer:
Klio2033 [76]4 years ago
7 0

Answer:

There is logic problem in condition of elseif statement that is (time<20).

Explanation:

elseif(time<20) will be true for time<10 that means program will never greet good morning as to make logic correct either change condition from <em>elseif(time<20)</em> to <em>elseif(time<20&& time>=10)</em>. Or change the order of condition like check first for <em>elseif(time<10) </em>

solution 1

if (time < 6) { greeting = "It is too early!"; }

else if (time < 20 && time>=10) { greeting = "Good Day!"; }

else if (time < 10) { greeting = "Good Morning!"; }

else { greeting = "Good Evening!"; }

console.log(greeting);

solution 2

if (time < 6) { greeting = "It is too early!"; }

else if (time < 10) { greeting = "Good Morning!"; }

else if (time < 20 ) { greeting = "Good Day!"; }

else { greeting = "Good Evening!"; }

console.log(greeting);

You might be interested in
_______________ is used by a hacker to mask intrusion and obtain administrator permissions to a computer.
Sergeu [11.5K]

Answer:

Rootkit.

Explanation:

Rootkit is a collection of software tools,mostly malicious.These are mostly used by hackers to obtain administrator permission to a computer by masking intrusion.

Root-kit is made from two word Root and kit.Where root refers to the name of privileged account on an operating system that is somewhat like unix and KIT refers to the tools used.

6 0
4 years ago
____________ define the allowable interactions between subjects and objects. credentials responsibilities procedures access cont
liq [111]
<span>Access controls define the allowable interactions between subjects and objects.
</span>They define contains rules which govern the interactions between subjects and objects and permissions subjects can grant to other subjects. The interactions between subjects and objects can be:<span> take, grant, create, remove...</span>
8 0
3 years ago
Read 2 more answers
Networks that are designed to connect similar computers that share data and software with each other are called:_______
sergij07 [2.7K]

Networks that are designed to connect similar computers that share data and software with each other are called: Peer to Peer (P2P) Networks.

<h3>What is a networking software?</h3>

A networking software can be defined as a set of executable instructions (codes) that is typically designed and developed to instruct a networking device on how to perform a specific task or transmit data from one location to another.

<h3>The types of networking software.</h3>

Generally, there are three main types of networking software and these include the following:

  • Security software
  • Connection software
  • Transport software

In Computer networking, Peer to Peer (P2P) Networks can be defined as a type of network that are designed and developed to connect similar computers that share data and software with each other.

Read more on Peer to Peer Networks here: brainly.com/question/1932654

#SPJ1

7 0
2 years ago
A(n) ____________ is special high-speed memory that allows a microprocessor to access data more rapidly than from memory located
iren [92.7K]

Answer is CPU cache

Explanation: A CPU cache is a special high-speed memory which is smaller and faster, and which helps to store copies of data from main memory location which are often used. It is actually located quite close to the processing core, and is used by the CPU of a computer to save time and energy in accessing data from the main memory.

The way it works is if the processor is either trying to read from or write to a particular location in the main memory, it checks to see if the data from the location is already in a cache, if it is, then it alternatively read from or write to the cache; which faster, instead of the main memory.

Please let me know if this helps.

7 0
3 years ago
Read 2 more answers
What is the meaning of antimonographycationalis​
Oliga [24]

Answer:

Although this word was made up in order to be a contender for the longest word in English, it can be broken down into smaller chunks in order to understand it.

Anti- means that you are against something; monopoly means the exclusive control over something; geographic is related to geography; and the remaining part has to do with nationalism.

So this word means something like 'a nationalistic feeling of being against geographic monopoly,' but you can see that it doesn't have much sense.

(answer copied from  Kalahira just to save time)

3 0
3 years ago
Read 2 more answers
Other questions:
  • Using tracking code, Google Analytics can report on data from which systems? A. E-commerce platforms.B. Mobile Applications.C. O
    11·1 answer
  • Question: when using a line graph, why is it important to only graph 1-3 series of data?
    8·1 answer
  • Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys) to integers (values) and a list o
    8·1 answer
  • The _device provides a means of communication between a computer and outer world.​
    14·1 answer
  • Create the following new exceptions: PokemonException, which extends the Exception class. It must have a no-parameter constructo
    13·1 answer
  • Question 1 of 10 Chase lives in Oregon but works for a company that is located in Florida. What business trend is this an exampl
    11·2 answers
  • What is ABC computer?​
    14·1 answer
  • Complete the statement by entering the appropriate term in the space below.
    13·2 answers
  • Keith would like to compare data he has collected from research. The data includes the electrical output
    13·1 answer
  • Which term refers to a shorthand method for identifying network and host bits in an ip address?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!