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
import java.util.Scanner;
public class App {
/**
* The start point of the program
*
* @param args
*
*/
public static void main(String[] args) {
Scanner keyBoard = new Scanner(System.in);
System.out.print("Enter Year Level: ");
int yearLevel = keyBoard.nextInt();
if (yearLevel == 1) {
System.out.println("College Level: Freshmen");
} else if (yearLevel == 2) {
System.out.println("College Level: Sophomore");
} else if (yearLevel == 3) {
System.out.println("College Level: Junior");
} else if (yearLevel == 4) {
System.out.println("College Level: Senior");
} else {
System.out.println("College Level: Unlisted Level");
}
keyBoard.close();
}
}
Comments
Leave a comment