1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rina8888 [55]
3 years ago
14

Suppose that a text file Exercise13_3.txt contains an unspecified number of scores.Write a c++ program that reads the scores fro

m the file and display their total and average.Scores are seperated by blanks.
Instead of displaying the results on the screen, send the results to an output named using your last name.

In addition to finding the average and total, find the number of grades.

Input

Example: Contents of Exercise13_3.txt:

70 88 91 95

66 82 71 99 84 57

80 100 93 73 82

Output

Contents of YourLastName.txt:

Your first and last name

Number of grades = 16

Total of all grades = 1231

Average grade = 82.1
Computers and Technology
1 answer:
ki77a [65]3 years ago
5 0

Answer:

#include <iostream>

#include <cmath>

#include <math.h>

#include <fstream>

#include <string>

#include <numeric>

using namespace std;

int main()

{

ifstream infile;

float num;

float total;

float x;

float aver;

x=0; total=0;

infile.open("Exercise13_3.txt");

while(!infile.eof())

{

infile>>num;

total=total+num;

x++;

}

aver=(total-num)/(x-1);

cout << "Number of grades = " <<x<< "\n";

cout<< "Total of all grades = " <<total<<'\n';

cout<< "Average grade = "<<aver<<'\n';

cout<< ""<<'\n';

infile.close();

getchar();

return 0;

}

You might be interested in
How does an Ac Machine work
Pani-rosa [81]

Answer:

In a split system, the compressor condenses and circulates the refrigerant through the outdoor unit, changing it from a gas to a liquid. The liquid is then forced through the indoor evaporator coil or cooling compartment. The indoor unit's fan circulates the inside air to pass across the evaporator fins.

Explanation:

(hope this helps)

6 0
3 years ago
In object-oriented programming, the object encapsulates both the data and the functions that operate on the data.
vovikov84 [41]

true, it is responsible for the management, scheduling, and coordination of task

7 0
4 years ago
Which of the following is not a type of bank?
andreyandreev [35.5K]
Where is the following banks that is listed?
3 0
3 years ago
Read 2 more answers
The dates of Spring Break should be included on your weekly calendar. Please select the best answer from the choices provided T
vivado [14]
False i hope that this helps you ! (:
3 0
4 years ago
Read 2 more answers
The Chairman of the Federal Reserve &amp; the Federal Open Market Committee determine the percentage of a deposit which must be
Scrat [10]
Required Deposit Reserve
6 0
4 years ago
Other questions:
  • Most Answers MOST ANSWERS
    11·2 answers
  • What causes the lens of the camera to extend or retract
    6·2 answers
  • Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percen
    13·2 answers
  • Why is the wizard able to install the printer when an actual print device is not connected to the computer??
    11·1 answer
  • Write a program that prompts the user for a name (any String value would work for testing), and print a hello message to the con
    5·1 answer
  • Which of the following organizations offers a family of business management system standards that details the steps recommended
    12·1 answer
  • I’m turning my Pinterest into a professional account what should be my user name please try to think of a good name and not just
    11·2 answers
  • Create a dynamic array of 100 integer values named myNums. Use a pointer variable (like ptr) which points to this array. Use thi
    6·1 answer
  • Autocad has _____ different ways to use the three point method if drawing and arc
    8·1 answer
  • What are the benefits and drawbacks of a desktop utilising virtualisation and a server?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!