Thread: Gradebook Program help

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    7

    Gradebook Program help

    I have an assignment for class and could use some help. I will post the problem below I just need advice on how I would store all the data. Also how would I access it after I store it. Side Note we are not allowed to use structures or objects.


    ASSIGNMENT

    For the purposes of this gradebook you should first provide a menu with the following options

    Add a new course
    Add a new student to a course
    Add grades for a student in a course
    Print a list of all grades for a student in a course
    Print a list of all students in a course
    Compute the average for a student in a course
    Compute the average for a course
    Store Gradebook (to a disk file)
    Load Gradebook (from a disk file)

    Each of these menu items should correspond to a function you will write.

    For the basic program each student will be represented by an ID number
    And each course by a course number
    Grades will be whole numbers only (no fractional part)
    As indicated in the menu you will need to store and load using a disk file so that the data is retained.
    Here are so limiting values to help you in defining your data structures:
    Maximum Number of students (total) 100
    Max number of courses 25
    Max number of courses per student 4
    Max number of grades per student per course 10

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    Side Note we are not allowed to use structures or objects.
    Then what are you allowed to use?

    You need to show your code for what you've tried.

    Jim

  3. #3
    Registered User
    Join Date
    Feb 2013
    Posts
    7
    Quote Originally Posted by jimblumberg View Post
    Then what are you allowed to use?

    You need to show your code for what you've tried.

    Jim
    I guess we can use anything else besides structures or objects. The only code I have now is the prototypes and the menu. I just need guidance on how i would store the course id and student id and then be able to look it up.

  4. #4
    Registered User migf1's Avatar
    Join Date
    May 2013
    Location
    Athens, Greece
    Posts
    385
    I guess it can be done using single and multi-dimensional arrays instead of structures, but it gets more complicated this way, so it's kinda a waste of effort imho.

    Btw, the assignment's wording seems to be using the term "data structures"...

    ...
    Here are so limiting values to help you in defining your data structures
    ...
    although I think it means arrays (since data structures are prohibited as you say).

  5. #5
    Registered User
    Join Date
    Feb 2013
    Posts
    7
    Quote Originally Posted by migf1 View Post
    I guess it can be done using single and multi-dimensional arrays instead of structures, but it gets more complicated this way, so it's kinda a waste of effort imho.

    .
    How would I be able to match up the student with their grades by using arrays?

  6. #6
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    How would I be able to match up the student with their grades by using arrays?
    This is called "Parallel Arrays", and is generally taught just before structs, in a programming class.

    It works for 2 record items, per record - but uses arrays instead of records (structs).

    i.e.:
    Code:
    Array1   Array2        Index Number  Array1 is a char array, Array2 is an int array.
    Name    Test Score
    John        88             0
    Ian         91             1
    Janice      89             2
    Linda       84             3
    Bob         78             4
    The common factor here is the index number. As long as "John" has the same index number: array1[0] as array2[0], (and all the others keep their same index number also), then you can go ahead and work with the data, with confidence - even sort the list by names, or by test score, whatever you like.

    Just be sure whenever you change the index number for either a name, or a test score, that you also change the associated other array data.

  7. #7
    young grasshopper jwroblewski44's Avatar
    Join Date
    May 2012
    Location
    Where the sidewalk ends
    Posts
    294
    There is nothing wrong with using multi-dimensional arrays, IMO, for this problem. The big drawback is that the amount of "records" you can store has a limit defined by the size of the array you declare.
    "Simplicity is the ultimate sophistication." - Leonardo da Vinci

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 12-11-2012, 12:25 AM
  2. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  3. Gradebook Program - Small Problem, Need Assistance
    By CaitlynCraft in forum C Programming
    Replies: 1
    Last Post: 11-13-2007, 09:51 PM
  4. Replies: 5
    Last Post: 08-16-2007, 11:43 PM
  5. Replies: 18
    Last Post: 11-13-2006, 01:11 PM