1. 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 76 84 82 242

To accomplish this task, you can use a programming language like Python. Follow the steps below:

a. Collect names of students from the user and create a data file "grades" with student records including test scores:

1. Open a file named "grades.txt" in write mode.
2. Start an input loop to collect student names and test scores.
3. Inside the loop, ask the user to input the name of a student.
4. If the input is "zzz", exit the loop and skip to step 6.
5. Otherwise, prompt the user to enter the test scores for test 1, test 2, and test 3.
6. Write each student's record (name, test1, test2, test3) as a line in the "grades.txt" file.
7. Close the file.

Here's some Python code that demonstrates this:

```python
file = open("grades.txt", "w")

while True:
name = input("Enter a student name (or 'zzz' to finish): ")
if name == "zzz":
break
test1 = int(input("Enter the score for test 1: "))
test2 = int(input("Enter the score for test 2: "))
test3 = int(input("Enter the score for test 3: "))

# Write the student's record to the file
file.write(f"{name} {test1} {test2} {test3}\n")

file.close()
```

b. Display the contents of the file "grades" with each student's record and their total score:

1. Open the "grades.txt" file in read mode.
2. Start a loop to read each line of the file.
3. Split each line into the student's name and the three test scores.
4. Convert the test scores from strings to integers.
5. Calculate the total score by adding test1, test2, and test3.
6. Print the student's name and their test scores, separated by spaces. Additionally, print the total score.
7. Repeat steps 2-6 for each line in the file.
8. Close the file.

Here's the Python code to accomplish this:

```python
file = open("grades.txt", "r")

for line in file:
# Split the line and convert scores to integers
name, test1, test2, test3 = line.strip().split()
test1 = int(test1)
test2 = int(test2)
test3 = int(test3)

# Calculate the total score
total_score = test1 + test2 + test3

# Display the student's record and total score
print(f"{name} {test1} {test2} {test3} {total_score}")

file.close()
```

By running the above Python code, you should be able to accomplish both parts a and b of the task.