Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //10.6.2015
- //BYOLab
- import java.util.Scanner;
- public class BYOLab
- {
- public static void main (String [] args)
- {
- Scanner input = new Scanner (System.in);
- System.out.println (" GPA Calculating Program");
- System.out.println (" by: Marshall Theis");
- System.out.println ("\nHow many classes do you have(5-7)? ");
- int numberOfClasses = input.nextInt ();
- input.nextLine();
- if (numberOfClasses >= 5)
- {
- //grades
- System.out.println ("What is the name of class 1? ");
- String class1 = input.nextLine ();
- System.out.println ("What is the name of class 2? ");
- String class2 = input.nextLine ();
- System.out.println ("What is the name of class 3? ");
- String class3 = input.nextLine ();
- System.out.println ("What is the name of class 4? ");
- String class4 = input.nextLine ();
- System.out.println ("What is the name of class 5? ");
- String class5 = input.nextLine ();
- String class6 = "a";
- String class7 = "b";
- if (numberOfClasses >= 6)
- {
- System.out.println ("What is the name of class 6? ");
- class6 = input.nextLine ();
- if (numberOfClasses == 7)
- {
- System.out.println ("What is the name of class 7? ");
- class7 = input.nextLine ();
- }
- }
- System.out.println ("\nWhat is your grade in "+ class1 +"? ");
- int grade1 = input.nextInt ();
- System.out.println ("What is your grade in "+ class2 +"? ");
- int grade2 = input.nextInt ();
- System.out.println ("What is your grade in "+ class3 +"? ");
- int grade3 = input.nextInt ();
- System.out.println ("What is your grade in "+ class4 +"? ");
- int grade4 = input.nextInt ();
- System.out.println ("What is your grade in "+ class5 +"? ");
- int grade5 = input.nextInt ();
- if (numberOfClasses == 6)
- {
- System.out.println ("What is your grade in "+ class6 +"? ");
- int grade6 = input.nextInt ();
- if (numberOfClasses == 7)
- {
- System.out.println ("What is your grade in "+ class7 +"? ");
- int grade7 = input.nextInt ();
- }
- }
- //points
- double points1=0;
- double points2=0;
- double points3=0;
- double points4=0;
- double points5=0;
- double points6=0;
- double points7=0;
- //GRADE1_____________________________________________________________GRADE1//
- //A
- if (grade1>=93)
- {
- points1 = points1 + 4;
- }
- //A-
- if (grade1>=90 && grade1<=92)
- {
- points1 = points1 +3.7;
- }
- //B+
- if (grade1>=87 && grade1<=89)
- {
- points1 = points1 +3.3;
- }
- //B
- if (grade1>=83 && grade1>=86)
- {
- points1 = points1 +3.0;
- }
- //B-
- if (grade1>=80 && grade1>=82)
- {
- points1 = points1 +2.7;
- }
- //C+
- if (grade1>=77 && grade1>=79)
- {
- points1 = points1 +2.3;
- }
- //C
- if (grade1>=73 && grade1>=78)
- {
- points1 = points1 +2.0;
- }
- //C-
- if (grade1>=70 && grade1>=72)
- {
- points1 = points1 +1.7;
- }
- //D+
- if (grade1>=67 && grade1>=69)
- {
- points1 = points1 +1.3;
- }
- //D
- if (grade1>=63 && grade1>=66)
- {
- points1 = points1 +1.0;
- }
- //D-
- if (grade1>=60 && grade1>=62)
- {
- points1 = points1 +0.7;
- }
- //F
- if (grade1>=0 && grade1>=59)
- {
- points1 = points1 +0;
- }
- //GRADE2_____________________________________________________________GRADE2//
- //A
- if (grade2>=93)
- {
- points2 = points2 + 4;
- }
- //A-
- if (grade2>=90 && grade2<=92)
- {
- points2 = points2 +3.7;
- }
- //B+
- if (grade2>=87 && grade2<=89)
- {
- points2 = points2 +3.3;
- }
- //B
- if (grade2>=83 && grade2>=86)
- {
- points2 = points2 +3.0;
- }
- //B-
- if (grade2>=80 && grade2>=82)
- {
- points2 = points2 +2.7;
- }
- //C+
- if (grade2>=77 && grade2>=79)
- {
- points2 = points2 +2.3;
- }
- //C
- if (grade2>=73 && grade2>=78)
- {
- points2 = points2 +2.0;
- }
- //C-
- if (grade2>=70 && grade2>=72)
- {
- points2 = points2 +1.7;
- }
- //D+
- if (grade2>=67 && grade2>=69)
- {
- points2 = points2 +1.3;
- }
- //D
- if (grade2>=63 && grade2>=66)
- {
- points2 = points2 +1.0;
- }
- //D-
- if (grade2>=60 && grade2>=62)
- {
- points2 = points2 +0.7;
- }
- //F
- if (grade2>=0 && grade2>=59)
- {
- points2 = points2 +0;
- }
- //GRADE3_____________________________________________________________GRADE3//
- //A
- if (grade3>=93)
- {
- points3 = points3 + 4;
- }
- //A-
- if (grade3>=90 && grade3<=92)
- {
- points3 = points3 +3.7;
- }
- //B+
- if (grade3>=87 && grade3<=89)
- {
- points3 = points3 +3.3;
- }
- //B
- if (grade3>=83 && grade3>=86)
- {
- points3 = points3 +3.0;
- }
- //B-
- if (grade3>=80 && grade3>=82)
- {
- points3 = points3 +2.7;
- }
- //C+
- if (grade3>=77 && grade3>=79)
- {
- points3 = points3 +2.3;
- }
- //C
- if (grade3>=73 && grade3>=78)
- {
- points3 = points3 +2.0;
- }
- //C-
- if (grade3>=70 && grade3>=72)
- {
- points3 = points3 +1.7;
- }
- //D+
- if (grade3>=67 && grade3>=69)
- {
- points3 = points3 +1.3;
- }
- //D
- if (grade3>=63 && grade3>=66)
- {
- points3 = points3 +1.0;
- }
- //D-
- if (grade3>=60 && grade3>=62)
- {
- points3 = points3 +0.7;
- }
- //F
- if (grade3>=0 && grade3>=59)
- {
- points3 = points3 +0;
- }
- //GRADE4_____________________________________________________________GRADE4//
- //A
- if (grade4>=93)
- {
- points4 = points4 + 4;
- }
- //A-
- if (grade4>=90 && grade4<=92)
- {
- points4 = points4 +3.7;
- }
- //B+
- if (grade4>=87 && grade4<=89)
- {
- points4 = points4 +3.3;
- }
- //B
- if (grade4>=83 && grade4>=86)
- {
- points4 = points4 +3.0;
- }
- //B-
- if (grade4>=80 && grade4>=82)
- {
- points4 = points4 +2.7;
- }
- //C+
- if (grade4>=77 && grade4>=79)
- {
- points4 = points4 +2.3;
- }
- //C
- if (grade4>=73 && grade4>=78)
- {
- points4 = points4 +2.0;
- }
- //C-
- if (grade4>=70 && grade4>=72)
- {
- points4 = points4 +1.7;
- }
- //D+
- if (grade4>=67 && grade4>=69)
- {
- points4 = points4 +1.3;
- }
- //D
- if (grade4>=63 && grade4>=66)
- {
- points4 = points4 +1.0;
- }
- //D-
- if (grade4>=60 && grade4>=62)
- {
- points4 = points4 +0.7;
- }
- //F
- if (grade4>=0 && grade4>=59)
- {
- points4 = points4 +0;
- }
- //GRADE5_____________________________________________________________GRADE5//
- //A
- if (grade5>=93)
- {
- points5 = points5 + 4;
- }
- //A-
- if (grade5>=90 && grade5<=92)
- {
- points5 = points5 +3.7;
- }
- //B+
- if (grade5>=87 && grade5<=89)
- {
- points5 = points5 +3.3;
- }
- //B
- if (grade5>=83 && grade5>=86)
- {
- points5 = points5 +3.0;
- }
- //B-
- if (grade5>=80 && grade5>=82)
- {
- points5 = points5 +2.7;
- }
- //C+
- if (grade5>=77 && grade5>=79)
- {
- points5 = points5 +2.3;
- }
- //C
- if (grade5>=73 && grade5>=78)
- {
- points5 = points5 +2.0;
- }
- //C-
- if (grade5>=70 && grade5>=72)
- {
- points5 = points5 +1.7;
- }
- //D+
- if (grade5>=67 && grade5>=69)
- {
- points5 = points5 +1.3;
- }
- //D
- if (grade5>=63 && grade5>=66)
- {
- points5 = points5 +1.0;
- }
- //D-
- if (grade5>=60 && grade5>=62)
- {
- points5 = points5 +0.7;
- }
- //F
- if (grade5>=0 && grade5>=59)
- {
- points5 = points5 +0;
- }
- //GRADE6_____________________________________________________________GRADE6//
- //A
- if (grade6>=93)
- {
- points6 = points6 + 4;
- }
- //A-
- if (grade6>=90 && grade6<=92)
- {
- points6 = points6 +3.7;
- }
- //B+
- if (grade6>=87 && grade6<=89)
- {
- points6 = points6 +3.3;
- }
- //B
- if (grade6>=83 && grade6>=86)
- {
- points6 = points6 +3.0;
- }
- //B-
- if (grade6>=80 && grade6>=82)
- {
- points6 = points6 +2.7;
- }
- //C+
- if (grade6>=77 && grade6>=79)
- {
- points6 = points6 +2.3;
- }
- //C
- if (grade6>=73 && grade6>=78)
- {
- points6 = points6 +2.0;
- }
- //C-
- if (grade6>=70 && grade6>=72)
- {
- points6 = points6 +1.7;
- }
- //D+
- if (grade6>=67 && grade6>=69)
- {
- points6 = points6 +1.3;
- }
- //D
- if (grade6>=63 && grade6>=66)
- {
- points6 = points6 +1.0;
- }
- //D-
- if (grade6>=60 && grade6>=62)
- {
- points6 = points6 +0.7;
- }
- //F
- if (grade6>=0 && grade6>=59)
- {
- points6 = points6 +0;
- }
- //GRADE7_____________________________________________________________GRADE7//
- //A
- if (grade7>=93)
- {
- points7 = points7 + 4;
- }
- //A-
- if (grade7>=90 && grade7<=92)
- {
- points7 = points7 +3.7;
- }
- //B+
- if (grade7>=87 && grade7<=89)
- {
- points7 = points7 +3.3;
- }
- //B
- if (grade7>=83 && grade7>=86)
- {
- points7 = points7 +3.0;
- }
- //B-
- if (grade7>=80 && grade7>=82)
- {
- points7 = points7 +2.7;
- }
- //C+
- if (grade7>=77 && grade7>=79)
- {
- points7 = points7 +2.3;
- }
- //C
- if (grade7>=73 && grade7>=78)
- {
- points7 = points7 +2.0;
- }
- //C-
- if (grade7>=70 && grade7>=72)
- {
- points7 = points7 +1.7;
- }
- //D+
- if (grade7>=67 && grade7>=69)
- {
- points7 = points7 +1.3;
- }
- //D
- if (grade7>=63 && grade7>=66)
- {
- points7 = points7 +1.0;
- }
- //D-
- if (grade7>=60 && grade7>=62)
- {
- points7 = points7 +0.7;
- }
- //F
- if (grade7>=0 && grade7>=59)
- {
- points7 = points7 +0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement