Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Your goal is to take in data from the user, write equations, using conditionals, and output results. Ask the user for their age and

c++ image text in transcribed
Your goal is to take in data from the user, write equations, using conditionals, and output results. Ask the user for their age and save this in a variable. Determine if the user is old enough to drive a car lat least 16 years old), vote (at least 18 years old), or gamble (at least 21 years old). Output the conditions that match the criteria. If the user is not able to do any of the activities based on their age, let them know that they are not old enough for the activity and how many years they must wait before they can do that activity. Example Output: Age: 7 You have 9 years until you are old enough to drive a car. You have 11 years until you are old enough to vote. You have 14 years until you are old enough to gamble. Example Output: Age: 19 You are old enough to drive a car. You are old enough to vote. You have 2 years until you are old enough to gamble. Example Output: Age: 35 You are old enough to drive a car. You are old enough to vote. You are old enough to gamble. Test your program several times using different input to ensure that it is working properly. Grading Rubric: - Take in the age from the user and store this a variable. ( 1 point)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions