Question: Suppose the input file scores.txt contains the following integer values: 92 0 88 100 60 42 0 67 Write a C++ program that first opens

Suppose the input file "scores.txt" contains the following integer values:

92

0

88

100

60

42

0

67

Write a C++ program that first opens the file "scores.txt", inputs the values, counts, computes the average, and outputs the following:

# students: 8

# non-zero: 6

# with 100: 1

Average: 74.8333

The 0's are not included in the average. In general, assume the input file contains 1 or more valid integers in the range 0..100, inclusive.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!