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
ladessa [460]
3 years ago
12

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.
Computers and Technology
1 answer:
Mama L [17]3 years ago
6 0

Answer:

Explanation:

data is a statement like

data 10,20, 30 , 40 , 50, 60 , 70, 80

\\the numbers represent ages.

For x := 1 to end of data do a[x]:=read(data)

\\ This is a comment. You could do this much easier if you just use three if statements rather than the if then else.

minor:=0;adult:=0;senior:=0;

while a[x] <> 0 do begin

age:= a[x]

if age < 19 then minor:=minor + 1;

If age > 18 then if age < 65 the adult:=adult + 1;

if age > 64 then senior := senior + 1;

end;

I have not declared the variables anywhere. That depends on what language you are using. The key step you  want are the three if statements. How you find out what's in them is another matter.

You might be interested in
Website hosting servers have their own unique IP address, what does this address consist of?
Alchen [17]
A. Numbers and letters
4 0
3 years ago
Once a table is inserted into a publication, which two tabs become available?
rusak2 [61]

Answer:

insert i think sry if its wrong :(

Explanation:

7 0
3 years ago
Car batteries have two terminals which are (blank).
Bumek [7]

Answer:

a positive and negative

3 0
4 years ago
Read 2 more answers
Several of the eap protocols use ____, which creates a ciphertext from cleartext.
Norma-Jean [14]
Several of eap protocols use encryption function, which creates a ciphertext from cleartext.
<span />
6 0
3 years ago
Which option is NOT in the Link to portion of the Insert Hyperlink dialog box?
WARRIOR [948]
Existing file or webpage
4 0
4 years ago
Read 2 more answers
Other questions:
  • The purpose of the ________ element is used to configure the main content of a web page document.
    5·1 answer
  • The malicious use of computer code to modify the normal operations of a computer or network is called a ___ .
    13·1 answer
  • A group of computers that are interconnected in order to share information or documents is called a _____
    9·1 answer
  • Average of Grades - Write a program that stores the following values in five different variables: 98, 87, 84, 100, 94. The progr
    8·1 answer
  • Write a program that displays the following menu:
    8·1 answer
  • Assume user_name equals "Tom" and user_age equals 22. What is printed on the console when the following statement is executed? c
    14·1 answer
  • All of the following are examples of software, except:
    5·2 answers
  • Select the correct answer from each drop-down menu. What is a distribution list and how is it selected?
    5·1 answer
  • What two things should you do before starting the design process
    8·1 answer
  • Which things computer case contains
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!