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
3.1.2 Quiz: What Can Information Technology Do for You? Question 8 of 10 What is one reason why a business may want to move enti
balu736 [363]

Answer:

C. To focus on a global market

Explanation:

Information technology can be defined as a set of components or computer systems, which is used to collect, store, and process data, as well as dissemination of information, knowledge, and distribution of digital products.

An information technology interacts with its environment by receiving data in its raw forms and information in a usable format.

Generally, it is an integral part of human life because individuals, organizations, and institutions rely on information technology and systems in order to perform their duties, functions or tasks and to manage their operations effectively. For example, all organizations make use of information technology and systems for supply chain management, process financial accounts, manage their workforce, and as a marketing channels to reach their customers or potential customers.

Additionally, an information system or technology comprises of five (5) main components;

1. Hardware.

2. Software.

3. Database.

4. Human resources.

5. Telecommunications.

Hence, information technology or system relies on the data it receives from its environment, processes this data into formats that are usable by the end users.

One reason why a business may want to move entirely online is to focus on a global market through the use of social media platforms and networks to reach out to customers in various geographical location.

5 0
3 years ago
Given the following MIPS Code Fragment:
galben [10]

Answer:

There are 3 Data Hazard

Explanation:

Find attached the solution

6 0
3 years ago
Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he’d like to learn if
Ronch [10]

The skills that are vital are:

  • Analytical skills to troubleshoot problems for clients.
  • The concentration and focus to be able to study and write computer code.

<h3>What are analytical and problem solving skills? </h3>

This is known to be the  ability of a person to be able to look into information in-depth so as to  tell the key or important elements, its strengths and weaknesses and others.

Therefore, The skills that are vital are:

  • Analytical skills to troubleshoot problems for clients.
  • The concentration and focus to be able to study and write computer code.

Learn more about Analytical skills from

brainly.com/question/2668962

#SPJ1

7 0
2 years ago
What were the advantages and disadvantages of agricultural technology to us.
Digiron [165]

Advantages of technology in agriculture include expediting crop production rate and crop quantity, which in turn reduces costs of production for farmers and food costs for consumers, and even makes crops more nutritious and livestock bigger and meatier.

The excessive use of chemicals by the help of machines reduces the fertility of the land.Lack of practical knowledge the farmers cant handle the machines properly.While the cost of maintenance is very high.Overuse of machines may lead to environmental damage.It is efficient but has many side effects and drawbacks.

5 0
3 years ago
Read 2 more answers
Remote authentication has always been a concern because the person is coming from a public network, and many companies require t
g100num [7]

Answer:

Incomplete Question.

I'll answer this question based on general terms

Explanation:

Two Factor Authentication, abbreviated as 2FA.

It is a type of authentication that requires the presentation of two credentials for access to personal data and information.

The credentials needed for a 2FA are

1. Either of the following; PIN, Password or Pattern

2. Your device or gadget which could be an ATM Card, Mobile Phone

3. Biometrics such as fingerprint, voice input

Number one is often referred to as "Something you know"

Number two is referred to as "Something you have"

Number three is referred to as "Something you are"

The 2FA doesn't require the three aforementioned credentials. It only needs just two of the credentials to provide its authentication.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Prompt the user ‘Enter a row vector of any numbers’ in the command window, and enter an arbitrary row vector and store it to x.
    6·1 answer
  • A ____ by a design professional is used to determine the best system to provide the appropriate level and type of protection.
    6·1 answer
  • Angle, oblique, regular, demi, roman, heavy, extra bold, expanded, and compressed are ___________ . Select one: A. type styles B
    10·1 answer
  • Generate an array x that has n=100 random numbers that are uniformly distributed over the interval [0,1) . Look up how to use th
    8·1 answer
  • In C++ Please :
    6·1 answer
  • _____ provide a description of the data characteristics and the set of relationships that link the data found within the databas
    8·1 answer
  • What are the benefits of maintaining your vehicle?
    5·2 answers
  • James has a USB flash drive that he has used at work. The drive needs to be thrown away, but James wants to make sure that the d
    12·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • If I am working in a document and wish to follow a hyperlink, what should I do?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!