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
nexus9112 [7]
3 years ago
8

Write an if/else statement that adds 1 to the variable minors if the variable age is less than 18, adds 1 to the variable adults

if age is 18 through 64 and adds 1 to the variable seniors if age is 65 or older.
if (age < 18) {

minors = minors + 1;

} else if (age > 17 && age < 65) {

adults = adults + 1;

} else {

seniors = seniors + 1;

}
Computers and Technology
1 answer:
boyakko [2]3 years ago
8 0

Answer:

See Explanation

Explanation:

The answer you attached to the question is correct and it does not need any additional input.

However, I'll explain each line for you

This line checks if age is less than 18

if (age < 18) {  

This line increases minors by 1

minors = minors + 1;

}

This line checks if age is between 18 and 64

else if (age > 17 && age < 65) {  

This line increases adult by 1

adults = adults + 1;

}

This line checks if age is greater than 18

else {

This line increases seniors by 1

seniors = seniors + 1;

}

You might be interested in
You just read a restaurant review on the internet of the newest restaurant in town. The writer of the article said the food was
Marizza181 [45]
A. The restaurant review contains data but is not data itself. 
I'm sorry if that's wrong, but that seems right to me. 

6 0
3 years ago
Anicius boethius invented a system that made possible the memorization and written transmission of melodies.
AURORKA [14]
The answer is false :)

7 0
4 years ago
Bcghxdfghncfghndfgxdfgjfjgktyerdgftguj
IgorLugansk [536]

Answer:

Okay

Explanation:

4 0
4 years ago
Read 2 more answers
The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
kenny6666 [7]
Regedit is the Answer
3 0
4 years ago
What are the benefits of using presentations to organize and deliver information?
bearhunter [10]
Hello.

The benefits of using presentations to organize and deliver information are: it keeps things in order, keeps peoples attention longer, and it looks more professional.
4 0
3 years ago
Other questions:
  • As a safe driver, you cannot, __________
    13·1 answer
  • What kind of printer is used with multipart forms such as those with point of sale machines?A) dot-matrixB) daisy-wheelC) inkjet
    5·1 answer
  • Which of the following is an accurate definition of a computer system? A computer system consists of the operating system that t
    6·1 answer
  • Which is not a factor that leads to technological advancement?
    8·1 answer
  • Which page in a web site do viewers usually see first?
    15·1 answer
  • ____ testing is a straightforward testing technique that looks for vulnerabilities in a program or protocol by feeding random in
    6·1 answer
  • A computer technician is responding to a call about a printer that is causing streaks to appear on every printout. Which of the
    5·1 answer
  • Customizable diagrams, including List, Process, and Cycle diagrams, are built into Word and can be found in
    7·1 answer
  • In the program below, which two variables have the same scope?
    9·2 answers
  • You hide three worksheets in a workbook and need to unhide them. How can you accomplish this?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!