| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
General - Help writing a program
Ok, first and foremost, let me first apologize for posting this, because I almost guarantee that there is prob. loads of other topics with very similar questions asked regarding the same type of thing. However, I am in a HURRY, this program is due tonight at midnight (it's currently around 8:30 p.m. where I live), so any help would be GREATLY appreciated.
Anyways, the program we're supposed to be designing is a loop. I have a terrible teacher, who hasn't taught me a damn thing, and I really need to learn and grasp the concepts with this because I'm going to major in Computer Science. So here goes. First, we can't use any array or functions in this. We're supposed to develop a program for a 5th grade teacher that computes students' averages as well as a class average. Class scores being stored in a file. The first line of the file contains the number of test scores per students and the rest are student records. Each record contains a student name and the test scores ranging in value from 0 to 100. Problem Requirements: 1. Read the number of test scores and student records until the end of file is reached. 2. Compute the average grade for each student 3. Print the letter grade for each student 4. print A if (90 to 100) 5. print B if (80 below 90) 6. print C if (70 below 80) 7. print D if (60 below 70) 8. print F if (below 60) 9. compute and display the average for the class (i.e., the average of the student averages) 10. assume all the scores are valid (between 0 and 100 inclusive) 11. display the output in a table format with a heading 12. display the number of test scores per student and the number of students in the class. For example, if the input file ola5.2 contains : 3 Tracy 80 91 67 Dana 0 66 44 Scott 50 41 64 Jamie 82 90 87 Jennifer 95 100 90 William 67 77 62 Wendy 90 96 84 Heather 80 91 86 John 100 100 99 Your output may look like : Please enter the file name that contains the student records: ola5.2 there are 3 scores per student Student name test1 test2 test3 final score grade ------------------------------------------------------- Tracy 80 91 67 79.33 C Dana 0 66 44 36.67 F Scott 50 41 64 51.67 F Jamie 82 90 87 86.33 B Jennifer 95 100 90 95.00 A William 67 77 62 68.67 D Wendy 90 96 84 90.00 A Heather 80 91 86 85.67 B John 100 100 99 99.67 A The class average is 77.00 There are 9 students. As another example, if the input file ola5.2b contains : 4 Tracy 80 91 67 78 Scott 50 41 64 72 Jamie 82 90 87 91 Jennifer 95 100 90 98 William 67 77 62 71 Wendy 90 96 84 95 Heather 80 91 86 84 John 100 100 99 100 Your output may look like : Please enter the file name that contains the student records: ola5.2b there are 4 scores per student Student name test1 test2 test3 test4 final score grade ------------------------------------------------------------- Tracy 80 91 67 78 79.00 C Scott 50 41 64 72 56.75 F Jamie 82 90 87 91 87.50 B Jennifer 95 100 90 98 95.75 A William 67 77 62 71 69.25 D Wendy 90 96 84 95 91.25 A Heather 80 91 86 84 85.25 B John 100 100 99 100 99.75 A The class average is 83.06 There are 8 students. So basically, I really need help with this. We've basically skipped from the bare basics of C++ right into this in about a week, and I have zero prior experience to actual programming. Help is appreciated, and I'm sure some of you experienced guys can figure this out in a matter of a minutes. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > General - Help writing a program |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|