we have to compute the letter grades for a course. The data is a collection of student records stored...
This problem has been solved!
Do you need an answer to a question different from the above? Ask your question!
Question:
Transcribed Image Text:
we have to compute the letter grades for a course. The data is a collection of student records stored in a file. Each record consists of a name(up to 20 characters), ID (8 characters), the scores of 10 homework assignments, a score for class participation, and the scores of three midterm tests and the final test (all positive integers). The maximum score a student can earn on any of these is 100. A sample file with 2 records is shown below: Pondicherry, John XPQ23456 91 48 76 0 23 91 91 84 95 93 81 76 84 91 73 Quincy, Jane XPL27856 81 58 76 40 73 49 91 84 89 93 90 79 94 81 73 Output Specifications. The output of the program is a file with the following data in each row <name>, <id>, <hwork&particpation score> <test score> <total score> <letter grade> The output for the above input would look like this: Pondicherry, John XPQ23456 38.65 39.7 78.35 C Quincy, Jane Note that all the fields in the output display are correctly aligned for easy reading; this requires the use of the setvidth operator, which is discussed in the early chapters of the text. XPL27856 39.2 40 79.2 C The rules for caleculating scores and the letter grade are as follows: • The aggregate score on the homework assignments and class participation (maximum of 50). The best nine homework scores and the class participation score are used to compute the score for the assignments and class participation. All of the assignments and the class participation have equal weight; the worst homework score is discarded and the other nine are added to the class participation score and this sum is scaled down so that the maximum is 50. (The sum of the best nine scores can be calculated as follows: Keep truck of both the sum and the minimum when you read from the file; at the end subtract the minimum score from the sum.) • The aggregate score on the tests (maximum 50).All the midterm scores are equally weighted, whereas the final exam carries twice the weight of each midterm (e.g., if midterm scores are 60, 70, 80, and final is 90, aggregate test score is 39 out of 50). • The total score (homeworks & participation + tests, maximum 100) • A letter grade (A (2 90), B (2 80), C (2 70), D (> 60) or F (< 60). Other requirements. We require a system that is flexible and does some simple checks on the data. Data Checks. The only data check is that all the raw scores should be between 0 and 100. If any of the scores is outside this range, the corresponding aggregate score and the overall score are recorded as -1.0 and the student is awarded a grade of Z. As an example, the data record Pondi, Joe XPQ23456 91 48 76 0 23 91 91 84 95 93 81 76 84 101 73 generates the output line Pondi, Joe XPQ23456 38.65 -1.0-1.0 Z (Here the first 10 scores are homework scores, the eleventh is the participation score and the last four are test scores. The lowest homework score, ie., 0, is dropped. One of the test scores is 101, so that function returns -1, and as a result the total score becomes -1, and the grade becomes Z.) Question 1. (Analysis and Design) Following the example of payroll program discussed in class (see handout on D2L) complete the analysis of the problem and top-level design of the solution. (Note that you will need a main unit and five sub-units.) The analysis should give following information: (i) A high level description of the process. (ii) A description of all the functional units to be created (name, purpose, parameters and return value; include a description of the strategy if the process is complicated). (iii) A set of (at least 10) test cases that check all aspects of the program, along with the expected results. Upload the word file to CourseFiles into the folder Project1. Question 2. (Stage 1 of implementation) Generate a script file showing the source, compilation of the program (using the g++ cominand), and the tests. Only the output function will be fully coded. The name and id will be read and stored, and all the remaining data will be skipped over using a getLine () statement. (Follow the example for the payroll program.) Upload the script to CourseFiles. Question 3. (Stage 2 of implementation) Write the C++ code for the hworkScore function. Compile and test the program to ensure that this function is working correctly. Generate a script file showing the testing of all aspects, including the data checks. Upload the script to CourseFiles. Question 4.(Stage 3 of implementation) Complete the code for the testScore function. Com- pile and test the program to ensure that this function is working correctly. Generate a script file showing the testing of all aspects, including the data validity checks. Upload to CourseFiles. Question 5.(Final Stage of implementation) Complete the code for the funetions that compute the total score and letter grade. Compile and test the program to ensure that these functions are working correctly. Generate a Neript file showing the tests. The program should also be tested on an empty file. Record all the test results in your test table. Upload to CourseFiles. Question 6. Reflect on your experience with this project. How carefully did you follow the specified steps? How did it affect your ability to complete the program? What are the pososible advantages of using such a structured(or systematic) approach? Upload to CourseFiles
Expert Answer:
Answer rating: 100% (QA)
Question 1 Analysis and Design i High level description of the process The program aims to read student records from a file and calculate their scores and corresponding letter grades It performs vario View the full answer
View Solution
Create a free account to access the answer
Cannot find your solution?
Post a FREE question now and get an answer within minutes.
* Average response time.
Posted Date: October 06, 2021 03:53:38