Create a program to compute numeric grades for a course

Assignment Help Computer Engineering
Reference no: EM1334462

You can add in to the program I made below. It is incomplete but you can use it so that you would have a quicker time to complete the program. Step by step explanations would help me since I am an online learner. The question is as follows:

Write a program to compute numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's last name, then one space, then the student's first name, then one space, then ten quiz scores all on one line. The quiz scores are whole numbers and are separated by one space. Your program will take its input from this file and send its output to a second file. The data in the output file will be the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

// Class average program with counter-controlled repetition

#include <iostream>

using std::cout;
using std::cin;
using std::end1;

const int MAX_GRADES = 10
// function main begins program execution
int main()
{
int total; // sum of grades input by user
int gradeCounter; // number of grade to be entered next
int grade; // grade value
int average; // average of grades

// initialization phase
total = 0; // initialize total
gradeCounter = 0; // initialize loop counter

// processing phase
while (gradeCounter<MAX_GRADES)
{ // loop MAX_GRADES times
cout << "Enter grade:"; // prompt for input
cin >> grade; // read grade from user
total = total + grade; // add grade to total
gradeCounter = gradeCounter + 1; // increment counter
}

// termination phase
average = total / MAX_GRADES; // integer division

// display result
cout << "Class average is " << average;
return 0; // indicate program
} // end function main

Reference no: EM1334462

Questions Cloud

The optimal strategy : With today's strain on revenue and cash flow, external auditors are getting squeezed to lower their fees. And they have to in order to keep business.  What do you think would be the optimal strategy?
Compute the value of the price index for gdp : Compute the value of the price index for GDP for 2006 using 2005 as the base year. By what percent did prices increase.
Show the value of understanding job analysis information : Value of understanding job analysis information - What is the value of understanding job analysis information as an operating manager?
Develop a linear programming model : The company has 1500 units of foam backing available for use. Develop a linear programming model for this problem. What is the objective function of this linear problem?
Create a program to compute numeric grades for a course : Write down a program to compute numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's last name, then one space, then the ..
By how much has the franc enchanced or depreciated : By how much has the Franc enchanced or depreciated against the dollar.
Answer to healthcare : Of the various organization theories that you studied, which is most appropriate for health systems and why and Under what conditions would vertical integration be an appropriate model, and why?
Analyze the outputs of green mountain coffee roasters : Analyze the outputs of Green Mountain Coffee Roasters using the Nadler-Tushman Congruence Model.
Develop a staffing plan for a new call center : Developing a staffing plan for a new call center - Determine how many people you need to hire and in what functional areas

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down a program using the vector class

create a program using vector class that allows the user to input the number of days worked in a 7 day workweek and, using a fixed hourly rate, calculates the weeks wages and the average number of hours worked per day.

  Computer instruction format

In the computer instruction format, the instruction length is 11 bits and size of an address field is 4 bits? Is it possible to have the 5 2-address instructions 45 1-address instructions 32 0-address instructions utilizing the format.

  How star configuration with a single router in the middle

A seven-story office building has 15 adjacent offices per floor. Each office contains the wall socket for a terminal in the front wall, so the sockets form a rectangular grid in the vertical plane, with a separation of 4 meters between sockets, bo..

  Why some companies may avoid beta releases

Cross (2007) discusses the benefits for a software company to release beta versions instead of final versions of products. What is Cross's reasoning? Do you agree with it? Explain why some companies may avoid beta releases from software companies.

  Describe a project that increase an intranet

Describe a project that increase an Intranet.

  What are an ethical dilemmas associated

What are the ethical dilemmas associated with using facial recognition software? Is this kind of software any different from a store asking to see your drivers license when you use your credit card.

  Find out the number of times a string is present

How to use Java classes to find out the number of times a string is present in another string.

  Where the size is the number of doubles to be sorted

Asks for values and stores them into an array of double. Sorts the values in ascending order according to the following algorithm, where size is the number of doubles to be sorted.

  Carrying out the investigation

You work for the mid-size corporation that is known for its inventions that does the lot of work of copyright and patent. You are investigating an employee suspected of selling and distributing animations generated for your corporation.

  Developing the modular program

Develop the modular program which asks user in order to enter the monthly costs for following expenses incurred from the operating his or her automobile: loan payment, gas, insurance, oil, tires, and maintenance.

  Write down the decimal equivalents for ieee floating point

Add the unsigned binary numbers then express the answer in decimal.

  Find the disadvantages of low quality

What are the advantages of high quality and the disadvantages of low quality.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd