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]
3 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]3 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
all of the following are new technology-related trends in mis except: group of answer choices the mobile digital platform. iot.
Bess [88]

The option that is note a new technology-related trends in MIS is co-creation of business value.

<h3>Technology and Management Information System:</h3>

Technology and Management Information System is known to be a term that connote the way a person can know or understand data that is obtained from a lot of units and departments of an organization.

Note that It can be used in the area of integration with other types of technology and as such, The option that is note a new technology-related trends in MIS is co-creation of business value.

Learn more about  business value from

brainly.com/question/25528419

#SPJ1

5 0
2 years ago
How the data is converted into the information?​
leonid [27]

Answer:

the data is converted into information by data processing

7 0
3 years ago
Read 2 more answers
What is likely to happen to the economy when there’s too much money or credit circulating?
Svetlanka [38]
It depends on HOW much money is circulating. If governments just print money with nothing to back it, hyperinflation occurs. If there's a bit too much money and credit, inflation happens. Generally, 3% inflation is considered normal and a healthy amount by economists.
5 0
3 years ago
What is a data source in OLE?​
babunello [35]

Answer:

OLE DB Driver for SQL Server uses the term data source for the set of OLE DB interfaces used to establish a link to a data store, such as SQL Server. Creating an instance of the data source object of the provider is the first task of an OLE DB Driver for SQL Server consumer.

Explanation:

hope it helps you and give me a brainliest

6 0
1 year ago
which of the following present the most significant obstacle to developing IT security if we consider commerce and marketing?
Dmitry_Shevchenko [17]

Answer:

There is no direct return on investment in building security systems.

Security systems are detrimental to usability and can make IT systems less functional, and therefore less attractive to the customer.

There is pressure to reduce the time it takes to get a new IT product or system onto the market, so security systems are sacrificed in order to reduce the time-to-market.

Explanation:

Cyber security has always been challenging for the organizations. There have been groups which are always looking for loop holes in cyber security and hacks the details and asks the ransom to restore. IT systems have now been more complex in this era. Users are increasing every new day and network accounts security is more demanding. Computer connection are more complex and require special attention to control them. The obstacles in IT systems are of concern as there is need for dynamic IT solution to counter the challenging hackers.  New programs and customized demand of IT systems need customized IT security systems.

4 0
2 years ago
Other questions:
  • In the range C15:G15, insert a function to calculate the total daily revenue. In the range H11:H15, insert a function to calcula
    8·1 answer
  • Which scientific law states that if a light source radiates isotropically, the light intensity falls off the further you get fro
    5·1 answer
  • You are contacted by a project organizer for a university computer science fair. The project organizer asks you to hold a forum
    10·1 answer
  • Benefits of computer in bank​
    5·1 answer
  • HI brainly friends....<br> Pease thanks my answers I will also thank your answers
    11·1 answer
  • Write a function named reverse_list that takes as a parameter a list and and reverses the order of the elements in that list. It
    12·1 answer
  • Write a program that uses a dictionary to store students birthdays. Your program should ask the user what their name is, and loo
    11·1 answer
  • How do i fix this to make it run ???
    9·1 answer
  • What is the school wifi password trying to do my class work in school on different devices.
    9·1 answer
  • In cells D6 through D8, enter formulas to calculate the values of the stocks. The formulas should multiply the number of shares
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!