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
Green field country is planning to conduct a cricket match between two teams A and B. a large crowd is expected in the stadium a
Angelina_Jolie [31]

Answer:

We need the Network Interface Card that supports serial transmission, and they are EIA RS-422A and RS-485 interfaces. Always remember that serial transmission is slower than parallel transmission, but they are less noisy as compared to the parallel transmission. In both of these NICs, we can have one transmitter and multiple receivers over a single line. And the length of the line can be as big as 6000 Feet and speed up to 10 MBPS, which is quite good for this question requirement.

Explanation:

Please check the answer.

7 0
2 years ago
What are two key benefits of using software tools for graphic design?
wel

Hi PaidBeno,

Two key benfits of using software tool like word or powerpoint give you the oppotunity to crate wonderful graphic designs. One example are the shapes and colors to create specific objects. the second benefit is using all the tabs on word that you can use for art to make it look real.

7 0
3 years ago
You are part of an Information Systems project team. Your job is to ensure that the technology and vendor suggested for use in t
jolli1 [7]

Answer:

information systems manager

Explanation:

Based on the information provided within the question it seems that your role in the project steering team is the information systems manager. This is a role that focuses on manages a group of IT professionals, as well as implementing new technology into the organization and making sure it fits the IS strategy. Which is what they seem to be expecting of you in this scenario.

5 0
3 years ago
"Users in your office are complaining that they cannot connect to the servers" at a remote site. When troubleshooting, you find
Arisa [49]

Answer:

VLSM is missconfigured between the router interface and the DHCP Pool

Explanation:

Variable-Length Subnet Masking (VLSM) can also be called "subnetting subnets, an it implies that network engineers are given the opportunity to be able to produce various sizes of IP address by dividing the IP address space into hierarchical subnets with the aim of creating subnets with relatively distinct host counts that avoids using too many addresses. The benefits of VLSM are that it brings about a more efficient network addressing, and it also allows network engineers to do route summarization.

A router refers to networking device which enables the sending of data packets among computer networks. It is also used to send data packets from VLSM to DHCP pool.

he Dynamic Host Configuration Protocol (DHCP) Pool refers to a built-in server employed in networks by Virtual Controller to assign IP address to clients. A simultaneous access to many clients can be achieved by customizing the DHCP Pool as it can accommodate about 2048 addresses.  

Whenever there the VLSM is missconfigured between the router interface and the DHCP Pool, some users under a different router will not be to connect to the servers while users using another router will be able to connect.

5 0
2 years ago
How has technology influenced photography? Would an image like this have been possible 100 years ago?
Anettt [7]

Answer:

Digital technology has changed the role of photography in society in many ways. Technology has advanced so much that photographs can be captured anywhere and anytime. Photos can be now sent to another person through text messages, shared online on emails, internal hard drives, and save onto usb's and memory cards.

Explanation:

you don't have a picture

4 0
2 years ago
Other questions:
  • A datagram network allows routers to drop packets whenever they need to. The probability of a router discarding a packetis p. Co
    15·1 answer
  • ____ is a limited version of windows that allows you to use your mouse, screen, and keyboard but no other peripheral devices.
    14·1 answer
  • Complete the sentence about a focusing technique.
    7·1 answer
  • On Brainly, how can I change my username? from halfsidepancake​
    6·2 answers
  • If a database required regular additions of new records which of these following would likely be a good tool to use
    7·2 answers
  • In order to plan George’s birthday, his father gave him a list of people who attended his birthday for the last five years. What
    8·1 answer
  • Given a high-level code you should be able to write the corresponding MIPS assembly code. Simple loop in C; A[ ] is an array of
    8·1 answer
  • Complete the steps for saving a presentation as a poi file,
    14·1 answer
  • If a work is in the public domain… Group of answer choices its copyright has expired. it may not be used for commercial purposes
    9·1 answer
  • If you click on repeat header rows, what will happen?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!