Homework 10: Arrays Homework
Wednesday, April 11, 2012[Up] [Previous Homework] [Next Homework]
Complete the following:
- NOTE: You need to start indenting your programs properly. Points will be taken off for not indenting this homework appropriately
- Reminder to look at CMSC104 Indentation Standards
- Create a copy of hw09.c called hw10.c
- Be careful you don't lose/overwrite your hw09.c
- Note that one directory up from your home directory is a directory called "backup" that stores a nightly backup of your entire home directory. You can look there for files that get corrupted/lost.
- You are going to implement the same program as hw09, but you will use arrays to store the set of homeworks, classworks, and quizzes.
- Modify the program to have an array of integers to store each of the classwork grades, an array for homework grades, and an array for quiz grades.
- Create the arrays as the maximum size of assignments for our class (16 classworks, 12 homeworks, and 5 quizzes)
- If the user tries to say there were more than that number of assignments, print an error and ask again.
- Keep track of all of the grades, and then after the user inputs them all, calculate the averages and the final GPA.
- After printing out the GPA, you should also print out a list showing the individual user classwork, homework, and quiz grades that were entered.
- After printing out the list of all values, also print the highest and lowest values for each set of items (classwork, homework, quizzes)
- Example run:
How many homeworks have been completed: 24 The maximum number of homeworks is 12, try again How many homeworks have been completed: 3 Home many classworks have been completed: 4 Home many quizzes have been completed: 2 Enter 1 if the final has been completed: 0 Enter homework 1 grade: 90 Enter homework 2 grade: 95 Enter homework 3 grade: 95 Enter classwork 1 grade: 20 Enter classwork 2 grade: 100 Enter classwork 3 grade: 100 Enter classwork 4 grade: 75 Enter quiz 1 grade: 90 Enter quiz 2 grade: 90 Your total GPA is: 89.1 Your homework scores are: 90, 95, 95 Highest homework score is: 95 Lowest homework score is: 90 Your classwork scores are: 20, 100, 100, 75 Highest classwork score is: 100 Lowest classwork score is: 20 Your quiz scores are: 90, 90 Highest quiz score is: 90 Lowest quiz score is: 90
- Create a script of you running your program twice.
- Once you are done, use submit to submit two files, hw10.c and typescript
linux3[1]% submit cs104_sheets hw10 hw10.c typescript