Home / Expert Answers / Computer Science / task-6-multi-branching-with-if-statements-and-switch-statements-write-a-class-called-gpa-java-tha-pa662

(Solved): Task 6: Multi-Branching with If Statements and Switch Statements Write a class called Gpa.java tha ...



Task 6: Multi-Branching with If Statements and Switch Statements
Write a class called Gpa.java that calculates the GPA of the

Task 6: Multi-Branching with If Statements and Switch Statements Write a class called Gpa.java that calculates the GPA of the letter grade input by the user. If the user enters: Letter Grade GPA A or a 4.0 B or b 3.0 Corc 2.0 D or d 1.0 For f 0 anything else "invalid entry" - first, use multi-branching (if statements) (introduce the logical operator ||) - Next, comment out the if statements (use a multi-line comment /*...*/) and replace them with a switch statement. (remember to take into account upper case and lower case) Test Case 1: What is your letter grade: C Your GPA is: 2.0 Test Case 2: What is your letter grade: b Your GPA is: 3.0 Test Case 1: What is your letter grade: Z Your GPA is: invalid entry


We have an Answer from Expert

View Expert Answer

Expert Answer


Solution: Java program for above given calculate GPA import java.util.Scanner; // Import the Scanner class public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // Create a Scanner object
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe