Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. (8 points) Write a class called VoteAge, which does the following: Ask the user to enter their age (ex. XX) Get the age

image text in transcribed

4. (8 points) Write a class called VoteAge, which does the following: Ask the user to enter their age (ex. XX) Get the age using a Scanner Tips If the age is greater than or equal to 18, it prints: "You are XX years old, old enough to vote." Otherwise, it prints: "You are XX years old, not old enough to vote." Use an if-else statement Submission Copy&Paste your source code. Screen shot the console with user input of 2 Screen shot the console with user input of 18 Sample Run Enter your age in years: 2 You are 2 years old, not old enough to vote. Enter your age in years: 18 You are 18 years old, old enough to vote.

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

3. Jessica said that (she, her) would like to see for herself.

Answered: 1 week ago