Chapter10 Examples
Chapter10 Examples
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
c. Modify the program of Part b so that at the option of the user, it displays either the entire
contents of the file "grades" or just the record of a specified student. In either case, for each
student displayed, also display his or her total test score.
Example #1 (Problem #1 Page 652) - Notes
• To_Integer() takes in a string and returns the integer number (e.g.
To_Integer("37") is 37)
Also assume that the records in this file are ordered by increasing part number. For each part of this
problem, write a program that performs the indicated task.
a. Input a part number from the user and delete the corresponding record from the "inventory" file.
b. Input a part number and a quantity from the user and modify the record corresponding to that
part number by changing the value of its last field to the quantity input.
c. Input a new part number, part name, and quantity from the user and insert the corresponding
record in the proper place in the "inventory" file.