All pastes #41371 Raw Edit

Error with percentag

public java v1 · immutable
#41371 ·published 2006-02-13 03:35 UTC
rendered paste body
import java.util.Scanner;public class StudentRecord {	public static void main(String[] args) {		boolean inputOK = false;		Scanner keyboard = new Scanner(System.in);		double[] quizScores = new double[3];		double midterm = 0;		double finalExam = 0;		int count = 0;		boolean anotherRecord = true;		int students = 0;		while (anotherRecord = true)			for (students = 0; students < 100; students++) {				Student studRec = new Student(quizScores[0], quizScores[1],						quizScores[2], midterm, finalExam);				if (inputOK == false) {					System.out							.println("Please input the quiz scores, separated by spaces.");					for (count = 0; count < 3; count++)						quizScores[count] = keyboard.nextDouble();					for (count = 0; count < 4; count++) {						if (quizScores[count] < 0 || quizScores[count] > 10) {							System.out.println("Incorrect value for quiz "									+ (count + 1) + ".  Enter a ");							System.out									.println("score between 1 and 10 and press Space.");							quizScores[count] = keyboard.nextDouble();						} else							inputOK = true;					}				}				inputOK = false;				if (inputOK = false) {					System.out							.println("Please enter the midterm score and press Space.");					midterm = keyboard.nextDouble();					if (midterm < 0 || midterm > 100) {						System.out								.println("Invalid value.  Enter a number between 1 and 100.");						midterm = keyboard.nextDouble();					} else						inputOK = true;				}				inputOK = false;				if (inputOK = false) {					System.out							.println("Please enter the final exam score and press Space.");					finalExam = keyboard.nextDouble();				}				double quizTotal = studRec.QuizTotal(quizScores[0],						quizScores[1], quizScores[3]);				System.out.println("Quiz total is " + quizTotal						+ " out of 25 possible points.");				double midtermScore = studRec.MidtermTotal(midterm);				System.out.println("Midterm total is " + midtermScore						+ ", out of 35 possible points.");				double finalScore = studRec.FinalTotal(finalExam);				System.out.println("Final total is " + finalExam + ", out of 40 possible points.");			}	double percentage = finalScore + quizTotal + midtermScore;	if(percentage <100 && percentage > 90)	System.out.println("Final Grade is an A.");	else if (percentage > 80)	System.out.println("Final Grade is a B.");	else if (percentage > 70)	System.out.println("Final Grade is a C.");	else if (percentage > 60)	System.out.println("Final Grade is a D.");	else System.out.println("Final Grade is an F.");					}}