I'm completely new to Java, and programming in general, and I'm trying to do something that I thought would be simple but I'm stumped. I probably did something wrong thats obvious to other people but not to me.
I'm trying to display a GPA after you put in the grades, but I have no idea what I did wrong.
import java.util.Scanner;
class grades {
public static void main(String args[]) {
Scanner myScanner = new Scanner(System.in);
int grade1;
int grade2;
int grade3;
int grade4;
int grade5;
int grade6;
char reply1;
char reply2;
char reply3;
char reply4;
char reply5;
char reply6;
double GPA;
System.out.print("What is the First period grade? ");
reply1 = myScanner.findInLine(".").charAt(0);
{grade1 = 4;} if (reply1 == 'A' || reply1 == 'a');
{grade1 = 3;} if (reply1 == 'B' || reply1 == 'b');
{grade1 = 2;} if (reply1 == 'C' || reply1 == 'c');
{grade1 = 1;} if (reply1 == 'D' || reply1 == 'd');
{grade1 = 0;} if (reply1 == 'F' || reply1 == 'f');
System.out.print("What is the Second period grade? ");
reply2 = myScanner.findInLine(".").charAt(0);
{grade2 = 4;} if (reply2 == 'A' || reply2 == 'a');
{grade2 = 3;} if (reply2 == 'B' || reply2 == 'b');
{grade2 = 2;} if (reply2 == 'C' || reply2 == 'c');
{grade2 = 1;} if (reply2 == 'D' || reply2 == 'd');
{grade2 = 0;} if (reply2 == 'F' || reply2 == 'f');
System.out.print("What is the Third period grade? ");
reply3 = myScanner.findInLine(".").charAt(0);
{grade3 = 4;} if (reply3 == 'A' || reply3 == 'a');
{grade3 = 3;} if (reply3 == 'B' || reply3 == 'b');
{grade3 = 2;} if (reply3 == 'C' || reply3 == 'c');
{grade3 = 1;} if (reply3 == 'D' || reply3 == 'd');
{grade3 = 0;} if (reply3 == 'F' || reply3 == 'f');
System.out.print("What is the Fourth period grade? ");
reply4 = myScanner.findInLine(".").charAt(0);
{grade4 = 4;} if (reply4 == 'A' || reply4 == 'a');
{grade4 = 3;} if (reply4 == 'B' || reply4 == 'b');
{grade4 = 2;} if (reply4 == 'C' || reply4 == 'c');
{grade4 = 1;} if (reply4 == 'D' || reply4 == 'd');
{grade4 = 0;} if (reply4 == 'F' || reply4 == 'f');
System.out.print("What is the Fifth period grade? ");
reply5 = myScanner.findInLine(".").charAt(0);
{grade5 = 4;} if (reply5 == 'A' || reply5 == 'a');
{grade5 = 3;} if (reply5 == 'B' || reply5 == 'b');
{grade5 = 2;} if (reply5 == 'C' || reply5 == 'c');
{grade5 = 1;} if (reply5 == 'D' || reply5 == 'd');
{grade5 = 0;} if (reply5 == 'F' || reply5 == 'f');
System.out.print("What is the Sixth period grade? ");
reply6 = myScanner.findInLine(".").charAt(0);
{grade6 = 4;} if (reply6 == 'A' || reply6 == 'a');
{grade6 = 3;} if (reply6 == 'B' || reply6 == 'b');
{grade6 = 2;} if (reply6 == 'C' || reply6 == 'c');
{grade6 = 1;} if (reply6 == 'D' || reply6 == 'd');
{grade6 = 0;} if (reply6 == 'F' || reply6 == 'f');
GPA = ((grade1 + grade2 + grade3 + grade4 + grade5 + grade6)/6);
System.out.print("Your child's GPA is ");
System.out.print(GPA);
}
}