Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a C++ program that prompts the user to enter a file name that contains the scores of students in a quiz. Each

 

 



1. Write a C++ program that prompts the user to enter a file name that contains the scores of students in a quiz. Each line in the input file contains a student name followed by the student's score (as shown in the sample file to the right). The program should then find out the students with the minimum score and the maximum score and display their names and scores. Marks.txt (sample) Ahmed 90 Badria 85 Noor 91 Khalid 70 Said 65 Suha 80 2. Develop a C++ function with following function prototype: double fileAvg (string fname); The function accepts the name of file as input and returns the average of the numbers in that file (the file is assumed to contain numbers only). Write a C++ main program that prompts the user to enter a file name that contains a set of numbers. The main program should calculate the average of the numbers in the file using the function fileAvg and display the returned value to the user.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Java Programming And Data Structures Comprehensive Version

Authors: Y. Daniel Liang

12th Edition

0136520235, 978-0136520238

More Books

Students also viewed these Programming questions