Results 1 to 3 of 3
  1. #1
    java_beaner is offline Member
    Join Date
    Sep 2011
    Rep Power

    Default Gradebook Program... Newbie

    Alright, so I'm new to Java programming and just started a class, Programming Essentials. We don't receive our books for another week so I've been learning everything online and through teachers review notes. I assume the code we're using is basically a stripped down version of old Java or C. I can't find anything like it on the net.

    My purpose here today was to get some help on a program that gets the students name, 4 test scores, displays the average, and then displays a letter representing the average.

    We're suppose to use only what we've learned from the notes given too us. This is were my problem comes in, how can I display the letter representing the grade without using an if or else statement, but just using variables and strings only. Here is what I have so far.

    class GradeBookProgram

    main ()

    string studentName

    num test1, test2, test3, test4

    num studentAverage

    ouput “Please enter student’s first and last name: ”
    input studentName

    output “Test 1 Score : ”
    input test1

    output “Test 2 Score : ”
    input test2

    output “Test 3 Score : “
    input test3

    output “Test 4 Score : “
    input test4

    studentAverage = test1 + test2 + test3 + test4/4
    studentGrade =

    //Displays the
    output = “Student Name: “ studentName
    output = “Test 1 Score: “ test1
    output = “Test 2 Score: “ test2
    output = “Test 3 Score: “ test3
    output = “Test 4 Score: “ test4
    output = “Student Average: “ studentAverage
    output = “Student Final Grade: “ studentGrade

    return //Ending the method
    endClass //Ending the class

    Oh, the letter average has to be A+, A-, B+, B-, C+, C-, etc... format. Any help is greatly appreciated.
    Last edited by java_beaner; 09-23-2011 at 06:11 PM.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default Re: Gradebook Program... Newbie

    That doesn't look like Java or C. I think that you'd first better find out exactly what programming language you're supposed to be using before wandering down the wrong path.

    And by the way, "old Java" looks pretty much like "new Java".
    Last edited by Fubarable; 09-23-2011 at 06:13 PM.

  3. #3
    Aero is offline Member
    Join Date
    Sep 2011
    Rep Power

    Default Re: Gradebook Program... Newbie

    There are things missing, it doesn't look a lot like java. So it's best if you know which language you're using. With Java you have to make changes to your code and you could use a switch.

Similar Threads

  1. GradeBook Program
    By just_in_deed in forum New To Java
    Replies: 0
    Last Post: 09-10-2011, 06:19 AM
  2. Newbie here with first database program
    By Jstn455 in forum JDBC
    Replies: 2
    Last Post: 03-16-2011, 02:51 AM
  3. GradeBook Class Modifications
    By awaken38 in forum New To Java
    Replies: 2
    Last Post: 02-07-2011, 09:55 PM
  4. Very newbie trying to run form program
    By projecttoday in forum New To Java
    Replies: 2
    Last Post: 01-12-2011, 06:28 AM
  5. Help with my first program...newbie
    By giganews35 in forum New To Java
    Replies: 6
    Last Post: 12-01-2008, 07:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts