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
Ilya [14]
2 years ago
15

Write a multi-way if/else statement that adds 1 to the variable reverseDrivers if the variable speed is less than 0, adds 1 to t

he variable parkedDrivers if the variable speed is less than 1, adds 1 to the variable slowDrivers if the variable speed is less than 40, adds 1 to the variable safeDrivers if the variable speed is less than or equal to 65, and otherwise adds 1 to the variable speeders.
Computers and Technology
1 answer:
andriy [413]2 years ago
4 0

Answer:

Code in Javascript.

<u>Preconditions: </u>

All the variables are defined and initialized.

if (speed < 0) { <em>// if speed is < 0 then adds 1 to reverse drivers.</em>

   reverseDrivers ++;

} else if (speed < 1) {  <em>// else if speed is < 1 then adds 1 to parked drivers.</em>

   parkedDrivers ++;

} else if (speed < 40) { <em>// else if speed is < 40 then adds 1 to slow drivers.</em>

   slowDrivers ++;

} else if (speed <= 65) { <em>// else if speed is <= 65 then adds 1 to safe drivers.</em>

   slowDrivers ++;

} else { <em>// else if speed is > 65 then adds 1 to speeders.</em>

   speeders++;

}

You might be interested in
Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
Katarina [22]

Answer:

The code is as follows:

for(int j = 0; j < newScores.length-1; j++){  

               newScores[j] = oldScores[j+1];  

           }  

           newScores[oldScores.length-1] = oldScores[0];

Explanation:

This loop iterates through the elements of oldScores

for(int j = 0; j < newScores.length-1; j++){  

This enters the elements of oldScores to newScores starting from the element at index 1

               newScores[j] = oldScores[j+1];  

           }  

This moves the first element of index 0 to the last index of newScores

           newScores[oldScores.length-1] = oldScores[0];

7 0
3 years ago
Your first submission for the CIS 210 Course Project should include the following functionality: - Requests the user to input hi
Viefleur [7K]

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String name;

 System.out.print("First name: ");

 name = input.next();

 name= name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();

 System.out.print(name);

}

}

Explanation:

This declares name as string

 String name;

This prompts the user for first name

 System.out.print("First name: ");

This gets the name from the user

 name = input.next();

This capitalizes the first letter of name and makes the other letters to be in lowercase

 name= name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();

This prints the formatted name

 System.out.print(name);

5 0
3 years ago
How do you fix this windows 7 screen​
tensa zangetsu [6.8K]

Try restarting it. If you can’t restart because the screen is frozen maybe just turn it off and back on. If you already tried restarting and it still didn’t fix the problem, just give it some time. The computer will reset itself eventually which should fix the problem.

6 0
3 years ago
Focusing on the general characteristics of a problem or object, while ignoring the details, is a technique called
Taya2010 [7]

Answer:

Abstraction

Explanation:

In computer science, abstraction has a similar definition. It is a simplified version of something technical, such as a function or an object in a program. The goal of "abstracting" data is to reduce complexity by removing unnecessary information. At some level, we all think of computers in abstract terms.

5 0
2 years ago
How can you tell if your car is overheating?
Nitella [24]
A) your temp gauge is moving into red
4 0
2 years ago
Read 2 more answers
Other questions:
  • Why was the movable type of the printing press such a breakthrough for publishing?
    15·2 answers
  • Some technologies like vertical farming have a number of negative effects. Which is a negative outcome of this technology? A. In
    10·1 answer
  • Write a calculator program using a switch statement that: a) Prompts the user to enter two numbers b) Prompts the user to select
    13·1 answer
  • Name three types of data stored on a computer’s hard disk
    11·1 answer
  • What is a computer briage coures​
    15·1 answer
  • Big data refers to huge collections of data that are difficult to process, analyze, and manage using conventional data tools. It
    13·1 answer
  • which program monitors the computer by looking for known trouble makers as well as suspicious behavior​
    11·1 answer
  • 1k bits equals to how many bits
    12·1 answer
  • The following is a function:
    6·1 answer
  • a developer manages an application that interacts with amazon rds. after observing slow performance with read queries, the devel
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!