Question: Python language The purpose of this assignment is to practice the use of Python input/output, loops, reading from files and selection features to develop a
The purpose of this assignment is to practice the use of Python input/output, loops, reading from files and selection features to develop a solution to the given problem. Your solution will consist of two parts: ( your name, university id, section number and your program design (written as comments at the beginning of your program by defining the purpose, input/output data, the algorithm, and test plan), (ii) The corresponding Python program. Problem Definition Write a program that prints out a student grade report. Assume there is a file, courses.txt, that contains the codes of all courses taught at the university, their names, and their credit hours. The format of the file is as shown by the example in Figure 1(left) BIOL2101:General Biology 1:4 CHEM2101:General Chemistry 1:4 COMP2101: Introduction to Computer Science:4 MATH2107:Calculus 2:4 LANC2058:Communication in Science: 3 STAT1001:Introduction to Statistics:4 11234 12547 16753 21886 A- Figure I: Sample content of input files: (left) courses.txt. (right) COMP2101.txt For each course, there is a file that stores student ID numbers and their grades in the course. The file name is the course code followed by "txt" (e.g. COMP2101.txt) and the format of its content is as shown in Figure 1(right). Write a program that asks for a student ID and prints out a grade report for that student, by searching all courses files. The program should first validate if there is any record for the given student ID by searching the content of the file students.ixt which includes the IDs of the registered students and their names as shown in Figure 2. Then based on the courses listed in the file courses.txt, the program should search each course file (e.g. COMP2I01.txt) to check whether the given student ID has a grade on that course. If the student has a grade then use it in the grade report as shown in Figure 3(c). 1234:Ahlam M 2547 Muhanad 6753:Ahmed 21886:Suaad 64832:Arva Figure 2: Sample content of atudents, txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
