JavaProgram/GPACalculator.java
JavaProgram/GPACalculator.java
/**
* GPACalculator
*
* The GPACalculator program implements an application to
* calculate and print new GPA by adding and mutiplying class, overall
* Grades with their respective credits and then dividing them by
* whole credit.
*
*
* @author your name
* @since 2021-01-23
*
*/
import java.util.Scanner;
import java.io.*;
public class GPACalculator{
/**
* This is the main method which is going to calculate the new GPA
* by utilizing given inputs in the GPA calculation formula,
* then prints the Student data and NewGPA on output screen.
* @param args Unused.
* @return Nothing.
* @exception IOException On input error.
* @see IOException
*/
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int StudentID, CurrentClassCredit, OverallCredit;
float CurrentClassGrade, OverallGrade;
/**
* Declared five variables
* StudentID Integer type,
* CurrentClassCredit Integer type,
* OverallCredit Integer type,
* CurrentClassGrade Float type,
* OverallGrade Float type
* And taking input from the user
* by using Scanner class.
*/
System.out.print("Enter Student id: ");
StudentID = input.nextInt();
System.out.print("Enter current class grade in GPA format (e.g. 3.5): ");
CurrentClassGrade = input.nextFloat();
System.out.print("Enter Current class number of credits: ");
CurrentClassCredit = input.nextInt();
System.out.print("Enter overall GPA: ");
OverallGrade = input.nextFloat();
System.out.print("Enter overall number of credits: ");
OverallCredit = input.nextInt();
/**
* Storing the returned result in variable NewGPA
* which is of the Float type.
...