Create GPA Calculator in Java Application program

And Install DrJava Introductory Programming Environment - download: DrJava Stable Release (http://www.drjava.org/)

Step 2: Before writing your codes you have to start your Java with “import java.util.Scanner;”. This tool allows users to input their data in. Then you need to create a class method as public class the name of your program, along with main method like public static void main (String args[ ]) and save it.
Note for each method you must use open and close bracket. The brackets tell the computer that the code belongs to the method.

Step 3: Declare and initialize your variables. In this step you need to know what type of data you should use. You should use string for grade to declare your variable because users need to enter grade in letter such as A, B+, C-, etc.  For declaring credit for each unit, total points for each class, total credits that you earn, and GPA you should use double because it might be decimals.

Step 4: Ask user to input data. Note the classes you want to include to figure out a specific GPA, e.g., a GPA for your minor or major.
• System.in stores users’ information (input).
For example:
- Scanner console = new Scanner (System.in);
• System.out.println is output and you can print your result.
For example:
- System.out.println("Please enter the number of credits of the class 1 (A number)");
- credit1 = console.nextDouble();

Step 5: Assign points to each grade for the included classes.
• Use if else statement to compare student grade with grade value and considering input validation.
• For each class, multiply the grade points by the number of units.
Note you need if/else statement and formula for all units, once you done with your first unit you can copy/paste the if/else statement and formula but DON’T FORGET TO CHANGE THE UNIT NAME.

Step 6: Create a formula to calculate your GPA.
• Divide the total number of grade points by the total number of units (credit).
• The result is your GPA.

Step 7: print out the GPA and round it by two decimals.
• Use System.out.printf("Your GPA is: %.2f\n", + gpa);
• Printf allows user to format their output.

Step 8: close your statement and program by using close brackets “}”.

Step 9: Compile and run the program.
• Compiler translates the code into computer language which is binary (0s and 1s). Also marks your syntax errors.
• Run button execute and test the program.

Step 10: test and double check your result and make sure it’s correct. (Double check for logic error because sometimes your result logically is wrong).

This is code algorithm for GPA Calculator:
“import java.util.Scanner;
public class StudentGPA {
public static void main (String args[]){

double credit1;
double credit2;
double credit3;
double credit4;
double totPtsClass1=0;
double totPtsClass2=0;
double totPtsClass3=0;
double totPtsClass4=0;
double totPts=0;
double totalCredits= 0;
double gpa;

Scanner console = new Scanner (System.in);
System.out.println("Please enter the number of credits of the class 1 (A number)");
credit1 = console.nextDouble();

else

System.out.println("Please enter the number of credits of the class 2 (A number)");
credit2 = console.nextDouble();

else

System.out.println("Please enter the number of credits of the class 3 (A number)");
credit3 = console.nextDouble();

else

System.out.println("Please enter the number of credits of the class 4 (A number)");
credit4 = console.nextDouble();

else

totPts= totPtsClass1+totPtsClass2+totPtsClass3+totPtsClass4;
totalCredits = credit1+credit2+credit3+credit4;
gpa= totPts / totalCredits;

System.out.printf("Your GPA is: %.2f\n", + gpa);
}
}”
<p>Hello. I am trying to create a different type of calculator but I can't figure out how to code it into C+ . do you know how to create multiple inputs with variable bases into c+?</p>
<p>Hello ,</p><p>The above code is nice one. However, we shared in 5 different formats which will helpful for the beginners. Source of code : https://javatutoring.com/java-program-to-calculate-cgpa/</p>