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
bixtya [17]
4 years ago
6

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:
sleet_krkn [62]4 years ago
3 0

Answer:

       if(age<18){

           minors+=1;

       }

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

           adults+=1;

       }

       else{

           seniors+=1;

       }

Explanation:

A java program with the variables created and initialized is given below:

import java.util.Scanner;

public class num3 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       System.out.println("Enter Age: ");

       int age = in.nextInt();

       int minors = 16;

       int adults = 20;

       int seniors =70;

       if(age<18){

           minors+=1;

       }

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

           adults+=1;

       }

       else{

           seniors+=1;

       }

   }

}

You might be interested in
When you're working with a word processing document and you press the del key, what happens?
LuckyWell [14K]
The correct answer is C.
6 0
3 years ago
How many comparisons will be done to find 8 in this list using a linear search?
Margaret [11]

Answer:

I think 4 comparisons

8 0
3 years ago
Suppose that outfile is an ofstream variable and output is to be stored in the file outputData.out. Which of the following state
katrin [286]

Answer:

outFile.open("outputData.out");

4 0
3 years ago
How is information sent across the internet binary
Annette [7]

Answer:

Binary information must be encoded in some way before transmission over the Internet. ... Copper wire is used to transmit binary messages using electricity - a voltage on the wire means one state, and no voltage means the other. Fiber-optic cables, on the other hand, use light (on or off) to transmit a binary message.

8 0
3 years ago
A ________ is an application program that runs on a server-tier computer and manages processes such as items in a shopping cart
garik1379 [7]
Commerce Server

An application program that runs on a server tier computer. A typical commerce server obtains product data from a database, manages items in users' shopping carts, and coordinates the checkout process.
6 0
2 years ago
Other questions:
  • Technology progresses so new needs can be satisfied.<br><br> A. true<br><br> B. false
    12·2 answers
  • In this assignment, you are going to add conditional formatting to the spreadsheet you used in the previous
    13·1 answer
  • Which are valid double statements for java? double a = 0; double b = -1.0; double c = -425; double d = 6340; double e = -1.0; do
    12·2 answers
  • Analyze the following code. Which of the following statements is correct?
    9·1 answer
  • Please help! 40 points + Brainliest!
    8·1 answer
  • How can the use of new technology in industry benefit the us government
    8·2 answers
  • a marketing company is setting up a new office in the city. which type of contract should they sign for periodic maintenance of
    15·1 answer
  • The physical parts of Computer are kwon as<br>​
    15·1 answer
  • Zoe wants to post something controversial online, but then she remembers that employers may look at her social media when she st
    10·1 answer
  • 8. Which of the following is an output device
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!