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
Nezavi [6.7K]
3 years ago
13

Write a statement that adds 1 to the variable reverseDrivers if the variable speed is less than 0,adds 1 to the variable parkedD

rivers 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:
ch4aika [34]3 years ago
3 0

Answer:

The c++ coding for this scenario is given below.

if( speed < 0 )

       reverseDrivers = reverseDrivers + 1;

   else if( speed >= 0 && speed < 1 )

       parkedDrivers = parkedDrivers + 1;

   else if( speed >= 1 && speed < 40 )

       slowDrivers = slowDrivers + 1;

   else if( speed >= 40 && speed <= 65 )

       safeDrivers = safeDrivers + 1;

   else

       speeders = speeders + 1;

Explanation:

First, five integer variables are declared and initialized.

int reverseDrivers = 0, parkedDrivers = 0, slowDrivers = 0, safeDrivers = 0, speeders = 0;

All the above variables need to be incremented by 1 based on the given condition, hence, these should have some original value.

Another variable speed of data type integer is declared.

int speed;

The variable speed is initialized to any value. User input is not taken for speed since it is not mentioned in the question.

Based on the value of the variable speed, one of the five variables, declared in the beginning, is incremented by 1.

The c++ program to implement the above scenario is as follows.

#include <iostream>

using namespace std;

int main() {

   int reverseDrivers = 0, parkedDrivers = 0, slowDrivers = 0, safeDrivers = 0, speeders = 0;

   int speed = 34;    

   if( speed < 0 )

   {

       reverseDrivers = reverseDrivers + 1;

       cout << " reverseDrivers " << endl;

   }

   else if( speed >= 0 && speed < 1 )

   {

       parkedDrivers = parkedDrivers + 1;

      cout << " parkedDrivers " << endl;

   }

   else if( speed >= 1 && speed < 40 )

   {

       slowDrivers = slowDrivers + 1;

      cout << " slowDrivers " << endl;

   }

   else if( speed >= 40 && speed <= 65 )

   {

       safeDrivers = safeDrivers + 1;

       cout << " safeDrivers " << endl;

   }

   else

   {

       speeders = speeders + 1;

       cout << " speeders " << endl;

   }    

return 0;

}

The program only outputs the variable which is incremented based on the value of the variable speed.

OUTPUT

slowDrivers

You might be interested in
How do you transfer music from external hard drive to a laptop?
weeeeeb [17]
You could download it to another device, and send the music to the laptop. That, or you can plug it into the USB port.
I hope this helps!
7 0
3 years ago
How many possible password of length four to eight symbols can be formed using English alphabets both upper and lower case (A-Z
Fynjy0 [20]

Answer:

In a password, symbol/characters can be repeated. first calculate the total

symbols which can be used in a password.

So there are total 26(A-Z),26(a-z),10(0-9) and 2(_,$) symbols.

that is equal to 26+26+10+2=64.

Total number of password of length 4:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64=16777216

Total number of password of length 5:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64*64=1073741824

Similarly,

Total number of password of length 6:

64*64*64*64*64*64=68719476736

Total number of password of length 7:

64*64*64*64*64*64*64=4398046511104

Total number of password of length 8:

64*64*64*64*64*64*64=281474976710656

Hence the total number of password possible is:285,942,833,217,536

7 0
3 years ago
____ is a form of software that includes a wide range of built-in functions for statistical, financial, logical, database, graph
Alex17521 [72]

Answer:

The answer is: Spreadsheet

3 0
3 years ago
patty works at Mcdonald's as a chef. it is her job to make hamburgers as each order arrives on her computer screen. one day patt
il63 [147K]
Angela should make sure the hamburger patty is disposed of and a new one prepared for the hamburger. She should reprimand Patty as what she did is wrong. Patty could well be fired for what she did. It is unsafe and unsanitary to give a customer food that has fallen on the floor. Angela should make sure this never happens again.

4 0
3 years ago
Read 2 more answers
The computer that process data that are represented in the form of discrete values are called​
Vinvika [58]

Answer:

Digital computer

Explanation:

The computer that process data that are represented in the form of discrete values are called digital computer.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which two editions of Windows 7 support 64 bit CPUs? Choose two out of Professional, Business, Starter, or Home Premium.
    12·1 answer
  • What is the accounting equation?
    12·1 answer
  • Briefly summarize two examples of cybercrime stories.<br> quick pleaseeee
    10·1 answer
  • What is the shortest, abbreviated version of the copy running-config startup-config command?
    6·1 answer
  • Which of the following is the best example of an installation issue?
    6·2 answers
  • Which of these is a valid use of the Reply All feature?
    11·1 answer
  • To have a reason or purpose to do something
    8·2 answers
  • Explain any two features of a computer​
    15·1 answer
  • in python i wrote a function where if the user inputs a certain word the function repeats over again, since the function aaks fo
    10·1 answer
  • Disadvantages of a grain crusher
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!