CS 010 - Introduction to Computer Science I
Assignment 6:

DUE: Friday, February 27 before 11:00pm


Collaboration Policy

This programming assignment is designed in part for us to determine how well you are able to program. Thus, every part of the program should be your own original work, and should not be substantially similar to other students' code, as well code from books, previous solutions, the web, etc. Like other skills (e.g., surgery), the only way to really learn programming is to do it yourself. Some collaboration is O.K., including discussing the general solution method, and some debugging assistance after a student has tried hard to solve the bug him/herself. We DO encourage you to work with others nearby, so if you get stuck, you can get help. But, you should not show your code to another student in order to help that student. For this assignment, copying code from another source (e.g., copy-and-paste, reading off of another's monitor, etc.) is not considered appropriate collaboration and will have severe consequences.


Turn in online to the appropriate folder for your lab section (e.g., as6_20 for students enrolled in lab section 20). There is a 20% point deduction if your assignment is not in the correct folder.

Remember to add your name, login, SID (last 4 digits), lecture and lab section numbers, and email address, to the header of your program


IMPORTANT:

You must turn in programming assignments as C++ source files. Spaces or non-alphanumeric characters in your filename may cause the turnin to not work. A good name for your file is as6.cpp.


Problem Definition:

Write a program that takes student data from an input file and outputs it in a specific format to an output file. You must use a structure to hold all of the data for one student. You are required to use a function that gets the data for one student from the input file and another function that outputs the data for one student to the output file.

The student data in raw.dat is as follows:

SID(last 4 digits), GPA(grade point average), DOB(Month, Day, Year: you must use a Date structure to hold this date), Completed Units (number completed so far), Current Units (number taking right now), expected graduation date (use the Date structure to hold this also).

You MUST use the following names for your data files:

     input file: raw.dat
     output file: nice.dat

The following is a sample run of the program using this input file, raw.dat. Your program should produce an output file that looks like this, nice.dat, when using this input file. Your program should ask the user how many students are in the input file.

Sample:

     This program takes the raw student data from an input
     file named raw.dat and outputs it in a more readable
     format to the file nice.dat.

     How many student records are in the input file?
     5

     The file nice.dat now holds the student records.


Suggestions:

Write each function first and test it using a driver program. For example, write the function that gets the data and then test it. Then write the output function and test it using your fully tested getData function. Then write your main that asks the user for how many students.


Points:

For all remaining programming assignments, if your program does not compile it will not be graded and you will receive 0 points for that assignment.