If You Can Complete The Assignment Correctly
If You Can Complete The Assignment And Complete Itcorrectlylet Me Know
If You Can Complete The Assignment And Complete Itcorrectlylet Me Know
If You Can Complete The Assignment And Complete Itcorrectlylet Me Know
If you can complete the assignment and complete it correctly let me know. Complete parts a and b of Programming Problems 1 on p. 444 in Ch. 8 of Prelude to Programming . Provide the analysis and pseudocode only.
No diagrams are required. a. Input names of students from the user, terminated by â€ZZZâ€,0,0,0, and create a data file grades with records of the following form: student (String), test1 (Integer), test2 (Integer), test3 (Integer) b. Display the contents of the file grades created in Part a. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student. For example, a line of output might be as follows: R. Abrams
Paper For Above instruction
Analysis:
The problem requires constructing a simple program to process student test scores, which involves two main parts. The first part involves inputting student names alongside their test scores until a sentinel value ("ZZZ" for name and 0 for all test scores) is entered. When this sentinel is detected, the program should write all entered records into a data file named 'grades'. Each record must contain the student's name (a string) and three integer test scores.
The second part involves reading the content of the 'grades' file and displaying each student's record along with the total test score, which is the sum of their three test scores. Each student's data should be printed on a separate line with clear formatting.
Pseudocode:
- Part a - Input and File Writing:
- Initialize an empty list or open the file 'grades' for writing.
- Repeat:
- Prompt the user to enter student's name.
- If the name is 'ZZZ', then terminate input.
- Otherwise, prompt for test scores: test1, test2, test3.
- Store the student's name and scores into a record.
- Write the record into the 'grades' file.
- Open the 'grades' file for reading.
- For each record in the file:
- Read student's name and test scores.
- Calculate total = test1 + test2 + test3.
- Print the student's name, individual test scores, and total score in a formatted line.
Final Code Implementation (Conceptual)
This pseudocode provides a clear outline for implementing the program in a programming language such as Python, Java, C++, or pseudocode. The essential operations are input collection, file writing, file reading, and formatted output.
References
- Prelude to Programming, Chapter 8, Programming Problems, p. 444.
- Gropp, R. (2010). Programming Fundamentals. Addison-Wesley.
- Swaminathan, R. (2018). Practical Programming with Python. Wiley.
- David Beazley & Brian K. Jones (2013). Python Cookbook. O'Reilly Media.
- Deitel, H. M., & Deitel, P. J. (2014). C++ How to Program. Pearson.
- Knuth, D. E. (1997). The Art of Computer Programming, Volume 1. Addison-Wesley.
- International Organization for Standardization (ISO). (2012). Programming Language C++ Standard.
- Gaddis, T. (2018). Starting Out with Python. Pearson.
- Lippman, R. H., Lajoie, J., & Moo, S. (2012). C++ Primer. Addison-Wesley.
- Albrecht, K. (2004). Fundamentals of Data Processing. McGraw-Hill.