• Post Reply Bookmark Topic Watch Topic
  • New Topic

trying to make ths work

 
Douglas Mclane
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class GradesProgram{ static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { //Section: Variablesint quiz1, quiz2;double tMidTerm, tFinal, tQuiz;int midTermExam = 0;int finalExam = 0;double finalScore = 0;char grade; String name; //Method: get Student Name void getName() { System.out.println("Students calculated final scores"); System.out.println("and letter grades. "); System.out.println("Please enter your name. "); name = (String) System.in.read();} //Method: get grades void getGrades(){ System.out.println("Please enter your first quiz grade. "); quiz1 = (int) System.in.read(); System.out.println("Please enter your second quiz grade. "); quiz2 = (int) System.in.read(); System.out.println("Please enter your midterm exam grade. "); midTermExam = (int) System.in.read(); System.out.println("Please enter your midterm exam grade. "); midTermExam = (int) System.in.read(); } //Method: Calculate Score void getScore() { tQuiz = (((quiz1 + quiz2)/20)*.25); tMidTerm = ((midTermExam/100)*.25); tFinal = ((finalExam/100)*.50); finalScore = tQuiz + tMidTerm + tFinal; } //Method: get letter grade void getLetterGrade if ( finalScore >= 90 ) {grade = 'A'; } if ( finalScore >= 80 ) { grade = 'B'; } if ( finalScore >= 70 ) { grade = 'C'; } if ( finalScore >= 60 ) {grade = 'D'; } { System.out.println( "Student name: " + name ); System.out.println( "First quiz score: " + quiz1 ); System.out.println( "Second quiz score: " + quiz2 ); System.out.println( "Midterm Exam score: " + midtermExam ); System.out.println( "Final Exam score: " + finalExam ); System.out.println( "Your final grade is: " + grade ); System.exit(0); }; //End Method: main
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.
I can't read the code you've posted. Please click on the icon above your post and use code tags to put some formatting into your code.
You will also need to tell us the details. What doesn't work? What do you expect the code to do?
Remember, the better question you ask, the more help we can be.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!