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
erastova [34]
3 years ago
12

Write a statement that adds 1 to the variable reverse Drivers if the variable speed is less than 0,adds 1 to the variable parked

Drivers if the variable speed is less than 1,adds 1 to the variable slow Drivers if the variable speed is less than 40,adds 1 to the variable safe Drivers if the variable speed is less than or equal to 65, and otherwise adds 1 to the variable speeders.
Computers and Technology
1 answer:
Ronch [10]3 years ago
5 0

Answer:

if (speed < 0){                // check if speed is less than zero(0)

  ++reverseDrivers;      // if it is, increment variable <em>reverseDrivers </em>by 1

}

else if (speed < 1) {        // else, check if speed is less than 1

  ++parkedDrivers;       // if it is, increment variable <em>parkedDrivers</em> by 1

}

else if (speed < 40){      //  else, check if speed is less than 40

 ++slowDrivers;            // if it is, increment variable <em>slowDrivers</em> by 1

}

else if (speed <= 65){     // else, check if speed is less than 65

 ++safeDrivers;              // if it is, increment variable <em>safeDrivers</em> by 1

}

else {                              // if none of the conditions above is satisfied

  ++speeders;                // increment variable <em>speeders</em> by 1.

}

Explanation:

The code snippet above represents a nested-if..else statement and it is written in Java with the following assumptions:

<em>1. all variables have been declared and initialized.</em>

<em>2. the variables have been wrongly typed as seen in the question. i.e reverse Drivers instead of reverseDrivers, parked Drivers instead of parkedDrivers and so on. Since there can not be spaces in naming variables, these have actually been corrected in the code.</em>

The code contains comments that explain every part of the code. Please go through the comments in the code carefully.

<em>Remember:</em>

i. The comments are the statements written after the double forward slash (//).

ii. Writing ++ before or after a variable increments that variable by 1. This also means adding 1 to that variable. So, for example, for variable <em>parkedDrivers, </em>whether we write ++parkedDrivers or parkedDrivers++, they will both increment the variable by one. Though there are differences between the two, it is still safe to use either one of them in this code.

<em>Hope this helps!</em>

You might be interested in
A form of brainstorming that serves as a visual aid to thinking laterally, helps explore a problem (usually by stating the probl
ELEN [110]

Answer:

The answer is BRAINSTORMING

Explanation:

<em>A visual aid to thinking laterally and exploring a problem, usually by stating the problem in the center  of the page and radiating outward spokes for components of the problem. Each component can then be considered separately with its own spokes, so that each point , thought, or comment is recorded.</em>

7 0
3 years ago
Data warehouse contains historical data obtained from the _____.
STALIN [3.7K]
D. operational databases
3 0
3 years ago
How do you play ps2 discs on a ps3 console
ExtremeBDS [4]
Look at the serial number. Find the sticker on the back of your PS3. The last digits will inform you as to whether you have full hardware backwards compatibility, or limited software emulation:
CECHAxx (60 GB) and CECHBxx (20 GB) - Full hardware backwards compatibility.
CECHCxx (60 GB) and CECHExx (80 GB) - Limited hardware emulation (These models do not contain the Emotion Engine, as it is instead emulated by the Cell processor). You may run into issues with some PS2 discs.
CECHGxx and above - These models are not backwards compatible.
8 0
3 years ago
eBay is an example of an online company that has been faced with numerous security issues. For example, imagine you purchase a d
beks73 [17]

Answer: Phishing

Explanation: Phishing is the type of security issue that arises when any individual is contacted by email or message to gain their confidential information through pretending as legal institution so that people can share their information easily.

eBay is also facing such cyber-crime issue so that customer's confidential data like debit card details, credit details details, passwords etc can be achieved through a illegal site posing to be eBay.

3 0
4 years ago
Your company has decided to hire a full-time video editor. You have been asked to find a system with the level of display qualit
mote1985 [20]

Answer:

"Resolution" and "Refresh rate" is the correct answer.

Explanation:

Resolution:

  • The resolution would be a step for describing the spatial brightness as well as cleanliness of something like a photograph but rather an image. It's always commonly being utilized for the performance evaluation of monitoring devices, digital photographs as well as numerous additional technology components.

Refresh rate:

  • A computer display as well as visualization technology feature that determines the equipment frequency as well as capacity for repainting or re-drawing that this whole presentation upon on-screen for every instant.
4 0
3 years ago
Other questions:
  • Only put coolant into your radiator when the engine is<br> A. on<br> B. hot<br> C. warm<br> D. cool
    6·1 answer
  • Which of the following is the BEST example of a strong password. Question 8 options: brian12kate5 chEwbAccAp!zza w3st! 123abccba
    10·2 answers
  • For a class Foo, one difference between a variable declared Foo * and a variable declared Foo &amp; is that only the variable de
    8·1 answer
  • If you wanted to search for emails containing the word advanced and prevent emails containing the word new from appearing in the
    14·1 answer
  • "Bullet Lists" can be which of the following?
    12·2 answers
  • Balance is the design principle that is represented when using the Crop tool?
    6·1 answer
  • A type of graph that uses horizontal bars to compare data is called a
    15·2 answers
  • A user tells a help desk technician that their browser is displaying a message that a site can't be
    14·1 answer
  • Help fast plzzzzzzzzzzzz ​
    10·2 answers
  • A group of users in a small publishing office want to share large image files in a common folder with high availability. Which o
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!