Answer to Question #280232 in Java | JSP | JSF for Bjoy

Question #280232

Create a program that will display the corresponding college level of s given input year level. The year and the college are given below:




Note: Use if else if statement.




Year Level College Level


1 Freshmen


2 Sophomore


3 Junior


4 Senior


Other years Unlisted Level








1
Expert's answer
2021-12-17T18:18:16-0500
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("Enter the year:");
        int year = in.nextInt();
        if (year == 1) {
            System.out.println("Freshmen");
        } else if (year == 2) {
            System.out.println("Sophomore");
        } else if (year == 3) {
            System.out.println("Junior");
        } else if (year == 4) {
            System.out.println("Senior");
        } else {
            System.out.println("Unlisted Level");
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog