Answer to Question #321115 in Java | JSP | JSF for Kevin

Question #321115

Using User defined Input create a java code of this output.

Output:

Enter your name: Kevin Alonzo

Enter grade in Math: 90

Enter grade in English: 88

Enter grade in Filipino: 98

Enter grade in Science: 87

Enter grade in: P.E: 98

Kevin Alonzo This is your GPA.

This is your GPA 92.2


1
Expert's answer
2022-03-30T15:48:50-0400


import java.util.*;


class App {


	public static void main(String[] args) {
		Scanner keyboard = new Scanner(System.in);


		System.out.print("Enter your name: ");
		String name = keyboard.nextLine();
		System.out.print("Enter grade in Math: ");
		int Math = keyboard.nextInt();
		System.out.print("Enter grade in English: ");
		int English = keyboard.nextInt();
		System.out.print("Enter grade in Filipino: ");
		int Filipino = keyboard.nextInt();
		System.out.print("Enter grade in Science: ");
		int Science = keyboard.nextInt();
		System.out.print("Enter grade in: P.E: ");
		int PE = keyboard.nextInt();
		System.out.print("Kevin Alonzo This is your GPA.\n");
		double GPA = (Math + English + Filipino + Science + PE) / 5.0;
		System.out.printf("This is your GPA %.1f\n", GPA);


		keyboard.close();
	}
}

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
APPROVED BY CLIENTS