Assignment Number 01
Using Classes: Money, Strings, and Streams
Reading: Part A of the Syllabus. See also the hand out material for the first day of classes.
Programming: This assignment is in four parts. They are to be done individually. Feel free to discuss your ideas with others, but write the programs on your own.
NOTE: For problems 1 and 2, write a short driver program and a function that does all the work. The program will not do much other than call the function and print a message when done.
Devise such a new mechanism. In other words – what might be a more effective way to represent money -- one that I could program. Tell me how I might go about building a new data type to represent your improved version of money. For example:
Turn In: For Parts 1 and 2 just turn in the two programs (no documentation is needed). For Part 3., present a concise, precise discussion, perhaps in list form, to tell me exactly what I would need to program.
Project: Write a program to compute a numeric total score and a letter grade for each student in this course. The file is in the following format:
For each line (data record) we have:
Each data element in a line is separated from the other elements by one or more blanks. Each exam score and the homework grade are represented by an integer between 0 and 100. Each quiz score is represented by an integer between 0 and 10. The Exam, Homework, and Quiz scores may appear in any order following the student’s first name.
NOTE: The homework grade counts 25% of the grade; each exam score counts 15%, and the quiz scores (taken together) count 30%. Be sure to verify that all input data is correct. If any single input item for a student is incorrect, generate a "data error" message and ignore that student record. HINT: Mark end of lines with a special symbol like #. WHY?
Your output for each student should appear exactly as the input except that the names should be left adjusted and the numeric data should be right adjusted so as to produce nice, neat columns. Two other data elements should appear on each line: the total weighted score, and a letter grade such as A, A-, B+, B, B-, …, D, D-, F. Be sure to properly annotate your output with a nice header indicating the name and number of the course, the instructors name, and the days and time of the course. Meaningful headers above the columns would also be helpful.
NOTE: The maximum weighted total score is 100. The mapping of total scores to letter grades is as follows: