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

A person is eligible to be a US senator if they are at least 30 years oldand have been a US citizen for at least 9 years. To be

a US representativethese numbers are 25 and 7, respectively. Write a program that accepts aperson's age and years of citizenship as input and outputs their eligibilityfor the Senate and House.
Computers and Technology
2 answers:
Fofino [41]3 years ago
7 0

Answer:

import java.util.Scanner;

public class num1 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       //Prompt for the person's age

       System.out.println("What is your age");

       int age = in.nextInt();

       //Prompt for the person's years of citizenship

       System.out.println("What is your years of citizenship");

       int yearsCitizenship = in.nextInt();

       if(age >= 30 && yearsCitizenship >= 9){

           System.out.println("You are Eligible to be a US senator");

       }

       if(age >= 25 && yearsCitizenship >= 7){

           System.out.println("You are Eligible to be a US representative");

       }

   }

}

Explanation:

Using Java Programming language

The scanner class is used to receive and store the persons age and year of citizenship

The first if statement is used to test if the age >= 30 and citizenship>=9 If this is true, it prints out You are Eligible to be a US senator. You are Eligible to be a US representative. Note that if the second condition is true, then the first is also true because to be eligible for senatorial also means you also meet the requirments for representative position

SCORPION-xisa [38]3 years ago
4 0

Answer:

age = int(input("Your age: "))

citizen = int(input("Years of being a US citizen: "))

if age >= 30 && citizen >= 9:

   print("You are eligible to US representative and a US senator")

elif age >= 25 && citizen >= 7:

   print("You are eligible to be a US representative")

else:

   print("You are not eligible to be a US representative or US senator")

Explanation:

Ask the user for its age, and years of citizenship

Check the both inputs:

If age is greater than or equal to 30 and citizen is greater than or equal to 9, it means the person is eligible for US representative and a US senator

If age is greater than or equal to 25 and citizen is greater than or equal to 7, it means the person is eligible for US representative

In any other case, the person is not eligible

You might be interested in
Order the steps for accessing the junk email options in outlook 2016
Zinaida [17]

Answer:

What is the question here? lol

Explanation:

8 0
4 years ago
Select the correct answer.
trapecia [35]
OA. programs do not represent data-rate to xomolemrixjf complexity
6 0
4 years ago
Compare the applications below:
alisha [4.7K]
Both can be the same thing
4 0
3 years ago
Read 2 more answers
Which is the base class in the following statement? class car : public vehicle
tatiyna

The base class in the following statements is the vehicle class.

<h3>What is a base class?</h3>

A base class is also known as a parent class.

A parent class is the existing class from which the other classes are determined and properties are inherited.

The class car is the child class. The child class inherit the properties of the parent class or the base class.

Therefore, the base class is the vehicle class.

learn more on class here; brainly.com/question/14293976

#SPJ11

8 0
2 years ago
If Mary makes homemade jams that she sells to her local grocer, she is practicing:
DIA [1.3K]

Answer: c) C2B (Consumer to business)

Explanation: Consumer to business (C2B) is the business technique in which the consumer or customer generates the good or service and then businesses are offered to take that product or service. The case mentioned in the question is also similar where May sells the jams made by her to the local grocer who has his business.

Other options are incorrect because Business to business (B2B) is where two business party trade with each other, Business to consumer (B2C) is business offer the product or service to consumer and Costumer to costumer(C2C) is the private trading of service between two individual parties. Thus,the correct option is option(c).

8 0
3 years ago
Other questions:
  • Which of the following best describes the purpose of child labor laws?
    13·2 answers
  • g Create your own data file consisting of integer, double or String values. Create your own unique Java application to read all
    7·1 answer
  • "the most common way to access the internet is through ________."
    5·1 answer
  • In which of these scenarios would the top 10 option be most helpful
    10·1 answer
  • Which of the following is a typical concern for developers while using prototypes?
    6·2 answers
  • What network monitoring technology enables a switch to copy and forward traffic sent and received on multiple interfaces out ano
    9·1 answer
  • What is the definition of delimited text?
    14·2 answers
  • What damage can a virus do to your computer?
    14·1 answer
  • ACME Corp. is developing a software program that can run on mobile devices so that customers can interact with the firm, view pr
    13·1 answer
  • During the POST process, the BIOS uses two (2) different ways to notify you of a problem, Error beep codes and error messages, e
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!