For each of the following problems, use the top-down modular approach

and pseudocode to design a suitable program to solve it.
1. Input names of students from the user, terminated by ZZZ, and
create a data file GRADES with records of the form:
student (string), test1 (integer), test2 (integer), test3 (integer)
In this file, all test scores should be set equal to 0.
2. Display the contents of the file GRADES created in Problem 1.
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:
R. Abrams 76 84 82 242

Here is the top-down modular approach and pseudocode to solve the given problems:

Problem 1: Creating the GRADES data file

1. Start the program.
2. Open a file named "GRADES" in write mode.
3. Initialize a variable named "student_name" as an empty string.
4. Initialize test1, test2, and test3 as integers and set them to 0.
5. Prompt the user to enter the student's name.
6. Read the input and store it in the "student_name" variable.
7. Check if the entered student name is "ZZZ".
8. If it is, go to step 12; if not, continue.
9. Write the "student_name", test1, test2, and test3 to the GRADES file.
10. Repeat steps 5-9 until the user enters "ZZZ".
11. Close the GRADES file.
12. End the program.

Pseudocode:

```
Open "GRADES" file in write mode

student_name = ""
test1 = 0
test2 = 0
test3 = 0

while True:
student_name = input("Enter student's name (or ZZZ to exit): ")
if student_name == "ZZZ":
break
write student_name, test1, test2, test3 to GRADES file

Close GRADES file
End program
```

Problem 2: Displaying the contents of the GRADES file

1. Start the program.
2. Open the GRADES file in read mode.
3. Initialize a variable named "line" as an empty string.
4. Read the first line from the GRADES file and store it in the "line" variable.
5. Repeat steps 6-10 until the end of the file is reached.
6. Split the "line" into student_name, test1, test2, and test3.
7. Calculate the total_score by summing test1, test2, and test3.
8. Print the student_name, test1, test2, test3, and total_score.
9. Read the next line from the GRADES file and store it in the "line" variable.
10. Repeat steps 6-9 until the end of the file is reached.
11. Close the GRADES file.
12. End the program.

Pseudocode:

```
Open "GRADES" file in read mode

line = read a line from GRADES file

while line is not empty:
student_name, test1, test2, test3 = split line by spaces
total_score = test1 + test2 + test3
print student_name, test1, test2, test3, total_score
line = read a line from GRADES file

Close GRADES file
End program
```

Note: The pseudocode provided gives an overall structure of the program, but you might need to modify it according to the specific programming language you are using, as different programming languages have slightly different syntax and file handling methods.