Not sure what I am doing wrong here or not understanding and I believe I am thrown off as far as the yes and no answer to my program I get the success the first time but when it calculates the answer it runs over itself and loops infinite
import java.util.Scanner;
public class patrickmahoney_assignment3 {
public static void main(String[] args) {
Scanner scan1 = new Scanner(System.in); //Setup Scanner
System.out.println("This program will calculate a students grade for the marking period.");
System.out.println(" ");
System.out.println("Do you want to calculate a student's overall grade? yes/no ");
String response = scan1.nextLine();
do {
System.out.println("Great! Let's get started.");
System.out.println(" ");
System.out.println("Please enter student's name: ");
// user inputs students name
String student = scan1.nextLine();
System.out.println("Please enter grades separated by a space... A1 A2 Ex P: ");
//Assignment 1 input by user
int A1 = scan1.nextInt();
//Assignment 2 input by user
int A2 = scan1.nextInt();
//Exercise input by user
int Ex = scan1.nextInt();
//Participation input by user
int P = scan1.nextInt();
//Print out user entered information and overall grade calculation
System.out.println("Student: " + student);
System.out.println("Grades: " + "\nA1= " + A1 + " " + "\nA2= " + A2 + " " + "\nEx= " + Ex + " " + "\nP= " + P);
System.out.println("Overall grade: " + (A1 * 0.25 + A2 * 0.25 + Ex * 0.4 + P * 0.1));
} while ("Yes".equalsIgnoreCase(response));
do {
System.out.println("Thanks for using the grade calculation program. ");
} while ("No".equalsIgnoreCase(response));
scan1.close();
}
}