# Semester Grade Calculator – Take 2

Following our review from the Thanksgiving break return, we’ll be covering an introduction to object oriented programming.

The first lesson will be a simple lesson almost verbatim from Blue Pelican Java. however, the second lesson will be to take the semester exam grade calculator created earlier in the week and adapt principles of OOP to it.

The code they are starting with is similar to the following:

```//Program Name: Unit 1 & 2 Review
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

import java.util.*;
import java.lang.*;
import java.io.*;

public static void main (String[] args){
int runAgain = 1;
while (runAgain == 1){
Scanner q1 = new Scanner(System.in);
Scanner pr4 = new Scanner(System.in);
double c = ((69.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
double b = ((79.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
double a = ((89.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
System.out.println("");
System.out.println("To score a C, you will need a minimum of a " + c + " on the semester exam.");
System.out.println("To score a B, you will need a minimum of a " + b + " on the semester exam.");
System.out.println("To score an A, you will need a minimum of a " + a + " on the semester exam.");
System.out.println("");
System.out.println("** NOTE: Negative grades indicate the exam could be skipped");
System.out.println("** NOTE: Grades over 100 indicate this average cannot be achieved");
System.out.println("");
Scanner runItAgain = new Scanner(System.in);
System.out.println("Would You Like to Perform Another Calculation?");
System.out.print("1 - Yes  /  0 - No : _ ");
runAgain = runItAgain.nextInt();
}
System.out.println("");
System.out.println("Program Complete - Exiting");
}
}```

They will be breaking the program into two separate parts. The main method will be handling keyboard inputs, screen outputs, and the while loop. The calculation method will be handling the calculations.

Here is a possible solution to the problem:

```//Program Name: OOP Concepts (File 1 of 2)
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

import java.util.*;
import java.lang.*;
import java.io.*;

public static void main (String[] args){
int runAgain = 1;
while (runAgain == 1){
Scanner q1 = new Scanner(System.in);
Scanner pr4 = new Scanner(System.in);
System.out.println("");
System.out.println("To score a C, you will need a minimum of a " + myGrade.c + " on the semester exam.");
System.out.println("To score a B, you will need a minimum of a " + myGrade.b + " on the semester exam.");
System.out.println("To score an A, you will need a minimum of a " + myGrade.a + " on the semester exam.");
System.out.println("");
System.out.println("** NOTE: Negative grades indicate the exam could be skipped");
System.out.println("** NOTE: Grades over 100 indicate this average cannot be achieved");
System.out.println("");
Scanner runItAgain = new Scanner(System.in);
System.out.println("Would You Like to Perform Another Calculation?");
System.out.print("1 - Yes  /  0 - No : _ ");
runAgain = runItAgain.nextInt();
}
System.out.println("");
System.out.println("Program Complete - Exiting");
}
}```
```//Program Name: OOP Concepts (File 2 of 2)
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

public class calculation{
public double a;
public double b;
public double c;