Question: Using switch statement, write Java program that will display the following options on screen: Help on: if statement ternary operator if..else statement Choose one: In
Using switch statement, write Java program that will display the following options on screen:
Help on: if statement
ternary operator
if..else statement
Choose one: In addition, the program should obtains the users selection. Based on the selection your program should do the following:
When option 1 is chosen, if, : -the program should prompt user for their name and age and display the name of the user and state whether the user is eligible for voting if their age is 18 years or more.
When option 2 is chosen, ternary operator, :- the program should prompt user for 2 integers and use a ternary operator to determine the maximum integer which should be displayed on the screen.
When option 3 is chosen, if...else statement, :- the program should prompt user for marks, integer whose value is between 0 and 100. The program will use if...else statement to determine the letter grade for that score based on the following criteria:
Grading Scale Score Grade 0-40 F 41-60 C 61-80 B 81-100 A
A good programmer ensures that their program has adequate comments.
Submission: Save the files as follows: 1.Notepad++/notepad saved as .java (Java files) with the java code. this could be copied from your Eclipse/NetBeans or written in notepad Submit the file on or before the due date
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
