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 user’s 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.


What will this small program output? class Main { } private static void foo(int x) { } System.out.println(x); public static void main(String[] args) { } int x = 15; foo(x); x = 18;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!