Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. Assignment Grade Calculation: A certain class has no more than 100 students and has 6
  2. Assignments each worth 20 points throughout the semester. Write a program that will read the
  3. names and scores of the students from a file. The name of the first student will be on the first
  4. line and their 6 scores separated by spaces on the next line (the two files your program will be
  5. tested against are given on Blackboard). This will repeat for all students in the class. First ask
  6. the user for the file name and open it for reading. Be sure that it opens properly. For every
  7. student in the class read in the name of the student into an array and their scores on the 6
  8. Assignments into a 2D array. It is possible to earn half a point grades (for example 18.5), somake the type of the array for the scores appropriate. The index of the name and row of the
  9. grades should link the two arrays as parallel.
  10. After the scores are read in, display a table that includes the student names, their scores on the
  11. assignments and their average after dropping the lowest grade.
  12. • Hint: combine the min and sum algorithms. When looking for the min if it's updated add
  13. the old min to the sum before updating; otherwise, add the current element to the sum).
  14. • Hint: Use an array to hold each student's average score, since we will need them later to
  15. calculate their average.
  16. Also below every column, the following should be displayed (see sample output below):
  17. • average for each assignment,
  18. • Bonus (2pts): the standard deviation for each assignment
  19. ◦ The standard deviation can be found by modifying the following formula
  20. ▪ std deviation = sqrt ( sum ((score[i][j] – average_score[j]) ^ 2) / number of scores)
  21. ◦ Hint: Use an array to hold the average score on each assignment. Then for each
  22. column use nested loops to sum up all the scores in that column minus the average in
  23. the column squared. After the inner loop, divide that answer by the the number of
  24. scores and then finally take the square root.
  25. • the number of students who earned an “A” (a score greater than or equal to 18) on the
  26. assignment
  27. For full credit:
  28. • Use parallel arrays for the name and scores
  29. • Use a partially filled array for the names
  30. • Use a 2D array for the scores
  31. • Use constants for the max number of students (100) and the number of
  32. assignments (6)
  33. • Display all numbers to one decimal point
  34. • Follow standard naming procedure for your variables (camelCase or under_score
  35. for variables and ALL_CAPS for constants) and use appropriate types (e.g. you
  36. may read the phone number as a string). Give the variables descriptive names.
  37. • Use spaces and comments to separate and describe the logical parts of your
  38. program so that it is easy to read
  39. • Indent code inside blocks, including the main function and any if, switch statements, or
  40. loops
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement