Lost with this program....

This is a discussion on Lost with this program.... within the C++ Programming forums, part of the General Programming Boards category; I would like to create a program with a Student class, which will have semesterHours and gpa as data members ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    6

    Lost with this program....

    I would like to create a program with a Student class, which will have semesterHours and gpa as data members that will keep track of the overall semesterHours and gpa for the student respectively. The Student class will also have an addCourse member function that will take an hour and a grade parameter. The hour value is the number of credit hours that the course is worth (such as 3 - - for 3 credit hours). The grade is the integer equivalent of the letter grade - - 4 for A, 3 for B, 2 for C, 1 for D, and 0 for F. The user will enter the hours and grade integer values and the addCourse function will update the overall semesterHours and gpa values accordingly.
    The program will prompt the user for the initial semesterHours and gpa values, then enter a repetition structure prompting the user for the hours and grade values until the user enters a sentinel value to stop entering course values, then display the semesterHours and gpa after exiting the loop.

    I am really lost with this one. Any suggestions on how to begin?

    Thanks

    Jamina

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    Your instructions are very specific.
    I would like to create a program with a Student class,
    Your first step.
    The Student class will also have an addCourse member function that will take an hour and a grade parameter.
    Step #2.
    The user will enter the hours and grade integer values and the addCourse function will update the overall semesterHours and gpa values accordingly.
    Third step.
    The program will prompt the user for the initial semesterHours and gpa values, then enter a repetition structure prompting the user for the hours and grade values until the user enters a sentinel value to stop entering course values, then display the semesterHours and gpa after exiting the loop.
    And you've pretty much written your program already.

    We're not going to help you unless you have some code to start out with.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    I'd start like this...
    Code:
    class Student
    {
      // add variables and methods
    };
    then perhaps, this is a stab in the dark so bear with me
    "..semesterHours and gpa as data members..."
    maybe you shold make a variable for each of those.


    The Student class will also have an addCourse member
    hmm... this was a tricky one, I couldnt really decode the above text but maybe just add a method called addCourse :
    Code:
    void addCourse(an hour and a grade parameter);

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Post your code so far.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 11:58 PM
  2. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  3. insufficient memory for tsr
    By manmohan in forum C Programming
    Replies: 8
    Last Post: 01-02-2004, 09:48 AM
  4. Date program starts DOS's date
    By jrahhali in forum C++ Programming
    Replies: 1
    Last Post: 11-24-2003, 05:23 PM
  5. Files Program... really lost
    By thynksheraze in forum C++ Programming
    Replies: 2
    Last Post: 09-25-2003, 08:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21