import java.io.*;
import static java.lang.System.*;
import java.util.Scanner;
class GPACalculator{
public static void main (String str[]) throws IOException{
Scanner scan = new Scanner (System.in);
double a;
double b;
double c;
double d;
double e;
double f;
double g;
double h;
double r;
System.out.println("Please enter the number of classes you have.");
r = scan.nextDouble();
if (r == 1);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Your GPA is " + a + ".");}
if(false)
return;
if (r == 2);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Please enter 'Class 2'");
b = scan.nextDouble();
double x = (double) (a + b)/2;
System.out.println("Your GPA is " + x + ".");}
if(false)
return;
if (r == 3);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Please enter 'Class 2'");
b = scan.nextDouble();
System.out.println("Please enter 'Class 3'");
c = scan.nextDouble();
double y = (double) (a + b + c)/3;
System.out.println("Your GPA is " + y + ".");}
if(false)
return;
if (r == 4);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Please enter 'Class 2'");
b = scan.nextDouble();
System.out.println("Please enter 'Class 3'");
c = scan.nextDouble();
System.out.println("Please enter 'Class 4'");
d = scan.nextDouble();
double z = (double) (a + b + c + d)/4;
System.out.println("Your GPA is " + z + ".");}
if(false)
return;
if (r == 5);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Please enter 'Class 2'");
b = scan.nextDouble();
System.out.println("Please enter 'Class 3'");
c = scan.nextDouble();
System.out.println("Please enter 'Class 4'");
d = scan.nextDouble();
System.out.println("Please enter 'Class 5'");
e = scan.nextDouble();
double w = (double) (a + b + c + d + e)/5;
System.out.println("Your GPA is " + w + ".");}
if(false)
return;
if (r == 6);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Please enter 'Class 2'");
b = scan.nextDouble();
System.out.println("Please enter 'Class 3'");
c = scan.nextDouble();
System.out.println("Please enter 'Class 4'");
d = scan.nextDouble();
System.out.println("Please enter 'Class 5'");
e = scan.nextDouble();
System.out.println("Please enter 'Class 6'");
f = scan.nextDouble();
double v = (double) (a + b + c + d + e + f)/6;
System.out.println("Your GPA is " + v + ".");}
if(false)
return;
if (r == 7);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Please enter 'Class 2'");
b = scan.nextDouble();
System.out.println("Please enter 'Class 3'");
c = scan.nextDouble();
System.out.println("Please enter 'Class 4'");
d = scan.nextDouble();
System.out.println("Please enter 'Class 5'");
e = scan.nextDouble();
System.out.println("Please enter 'Class 6'");
f = scan.nextDouble();
System.out.println("Please enter 'Class 7'");
g = scan.nextDouble();
double u = (double) (a + b + c + d + e + f + g)/7;
System.out.println("Your GPA is " + u + ".");}
if(false)
return;
if (r == 8);{
System.out.println("Please enter the number corresponding with your class grades.");
System.out.println("A = 4, B = 3, C = 2, D = 1 and F = 0");
System.out.println("Please enter 'Class 1'");
a = scan.nextDouble();
System.out.println("Please enter 'Class 2'");
b = scan.nextDouble();
System.out.println("Please enter 'Class 3'");
c = scan.nextDouble();
System.out.println("Please enter 'Class 4'");
d = scan.nextDouble();
System.out.println("Please enter 'Class 5'");
e = scan.nextDouble();
System.out.println("Please enter 'Class 6'");
f = scan.nextDouble();
System.out.println("Please enter 'Class 7'");
g = scan.nextDouble();
System.out.println("Please enter 'Class 8'");
h = scan.nextDouble();
double t = (double) (a + b + c + d + e + f + g + h)/8;
System.out.println("Your current GPA is " + t + ".");}
if(false)
return;
}
}