• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

trying to make ths work  RSS feed

 
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
 
Bartender
Posts: 9511
12
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!