Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb. If the age is less than 13, print: “too young to create a Facebook account”c. If the age is less than 16, print: “too young to get a driver's license”d. If the age is less than 18, print: “too young to get a tattoo”e. If the age is less than 21, print: “too young to drink alcohol”f. If the age is less than 35, print: “too young to run for President of the U.S.” and on next line print: “(How sad!)”g. If the age is greater and equal to 35, print: “able to do anything” and on next line print: “(How happy!)”Use an if statement

Question

Write a class, AgeMessages , which does the following:
a. Ask the user to enter age using a Scanner
b. If the age is less than 13, print: “too young to create a Facebook account”
c. If the age is less than 16, print: “too young to get a driver's license”
d. If the age is less than 18, print: “too young to get a tattoo”
e. If the age is less than 21, print: “too young to drink alcohol”
f. If the age is less than 35, print: “too young to run for President of the U.S.” and on next line print: “(How sad!)”
g. If the age is greater and equal to 35, print: “able to do anything” and on next line print: “(How happy!)”

Use an if statement

Expert Answer

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Engineering Q&A

Find answers to questions asked by student like you

Q: Provide a functional block diagram for a concept for an autonomous transportation and/or delivery th...

A: Autonomous transportation is the evolution of transport where the vehicles are connected to create a...

Q: Don't really know how to start solving this problem.

A: Using 4 bit counter we can implement a modulo 12 synchronous counter by ensuring that all the flip f...

Q: Hello, I am trying to write a program: Write a .py file like MainFiles.py In that .py, create a func...

A: A python file is created named as MainFiles.py:Def main( ):Print(“ Welcome to python”)The above pyth...

Q: For do this program you need to use Eclipse  Write a program called AveMethod (main method) that con...

A: Program plan:Define the class “AveMethod”.Define the class “main”Create an object for scanner class....

Q: What is the CPU time if the number of instructions executed by the program is 500 cycles per instruc...

A: CPU time:The formula for computing the CPU time is provided below:

Q: Hello! Write a C++ Program that simulates a basic calculator using functions which performs the oper...

A: Solution:Given data,The C++ code to perform the calculator operations using function is given below:...

Q: Which of the following is true? I. The 80/20 rule states that 80% of the instruction is executed and...

A: 80/20 rule was first introduced by Vilfredo Pareto and therefore in also commonly known as Pareto pr...

Q: Consider the sender A transmits 12 data packets to B using stop wait protocol. If every 3rd packet i...

A: Analysis:In stop and wait protocol, the data packets will be transmitted as follows:1, 2, 3, 3, 4, 5...

Q: Which element is required in a web application to operate the Server-Sent Events? a. c. eventsource...

A: Correct answer:The correct option is “c”.Explanation:“<eventsource>” is the element used in a ...