C programming (Strings and file I/O)   Write a program that asks the user for 5 names and 5 scores (0 to 100) for the test, and write the names and scores to a file (test_score.txt). Read the file to find and display the average, lowest, and highest scores. If the name the user enters is "Jacob," assign 100 points to Jacob's score, regardless of what the user enters.   Input Example James 80 Peter 76 Amy 67 Jacob 94 Jenny 92   Output Example Jacob has the highest score of 100. Amy has the lowest score of 67. The average of the test is 83

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 6PP: (Data processing) Write a C++ program that reads the file created in Exercise 4 one record at a...
icon
Related questions
Question

C programming (Strings and file I/O)

 

Write a program that asks the user for 5 names and 5 scores (0 to 100) for the test, and write the names and scores to a file (test_score.txt). Read the file to find and display the average, lowest, and highest scores. If the name the user enters is "Jacob," assign 100 points to Jacob's score, regardless of what the user enters.

 

Input Example

James 80

Peter 76

Amy 67

Jacob 94

Jenny 92

 

Output Example

Jacob has the highest score of 100.

Amy has the lowest score of 67.

The average of the test is 83.  // (80+76+67+100+92)/5

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning