Write a program to compute numeric grades for a course.

Assignment Help Operating System
Reference no: EM13943148

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: EM13943148

Questions Cloud

What is the purchase price of the wine in us dollars : WSM Wine Importers, Inc. purchased 75,000 cases of French wine at a cost of 6,000,000 Euros. If the current exchange rate is 0.7576 Euros to the U.S. dollar, what is the purchase price of the wine in U.S. dollars?
Write a function isvowel() that test whether char is vowel : Use your function in a program that reads the standard input file and writes to the standard output file, deleting all vowels
Compare and contrast online analytic processing : Write a one page paper (250 words) on Compare and contrast Online Analytic Processing (OLAP) and Online Transaction Processing (OLTP); also discuss Codd's rules for TP databases and OLAP databases (New Times Roman, 12 pt, double spaced, Essay). Ci..
Specific drug that can be purchased over-the-counter : Discuss one specific drug that can be purchased over-the-counter, and is often misused. Discuss ways can a nurse help a client/ family to be compliant with medications that do not require a prescription
Write a program to compute numeric grades for a course. : 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
Whether the company decision to be more ethical : Your presentation should include some analysis of whether the company's decision to be more ethical is proving to be a success amongst consumers or not, providing example of why that is the case.
What are the supporting torques : What is the very largest torque T that can be applied with elastic behavior everywhere? (Hint: cut combined shaft at C and consider separate shaft). What are the supporting torques?
Seminal paper by diffie and hellman : Appearing in the seminal paper by Diffie and Hellman, the first published public-key algorithm that defined public-key cryptography [DIFF76] is referred to as the Diffie-Hellman key exchange (Stallings & Brown, 2008, p. 641).
Discuss one specific drug given for alzheimer : Discuss one specific drug given for Alzheimer's. What ways can a nurse help a client/ family to be compliant with medications for Alzheimer's disease

Reviews

Write a Review

Operating System Questions & Answers

  Purpose to apply the compensation knowledge in real-world

purpose to apply the compensation knowledge in real-world situation. the task formulating a compensation strategy for

  Why the lynx companys functional system has been successful

Consider the following scenario involving a functional system used by the Lynx Company. The Lynx Company uses a functional system for their sales system. Identify five reasons why the Lynx Company's functional system has been successful (be sure t..

  List and give a brief overview of any five programs

Using the material you learned in this topic, create instructions that can show a new Windows 7 and Office 2010 user at least three different ways to open a program in Microsoft Windows

  A spawned process

A spawned process may be destroyed automatically when its parent is destroyed, as one method; another design is to have spawned processes proceed independent of the parent

  What are the seven layers of the open source interconnection

What are the seven layers of the Open Source Interconnection (OSI) model? What is the function of each layer

  Busy waitingis there any benefit to busy waiting

busy waitingis there any benefit to busy waiting? discuss.barrier synchronizationdiscuss an application that would

  A borg unimatrix has 40-bit virtual addresses

A Borg Unimatrix has 40-bit virtual addresses and 32-bit physical addresses. Pages are 32 KB in size. How many entries are needed for the page table? Give all formulas, steps, and compute out the final number as an integer(in humanly readable deci..

  How long should a system be idle to benefit from hibernating

If reading or writing a cache-line of size 64 bytes to Flash requires 2.56 ?J and DRAM requires 0.5 nJ, and if idle power consumption for DRAM is 1.6 W (for 8 GB), how long should a system be idle to benefit from hibernating? Suppose a main memory..

  Operating system provides a mechanism for configuring

Operating system provides a mechanism for configuring the behavior of the keyboard attached to the computer. Outline the behavior of the following sets of keys after they have been configured correctly

  Describe the concept of a signal, and indicate configuration

When a child process is fork()ed, a parent may wait for the successful completion of the child via the wait() service (or one of its variants) so that the return result of that application can be read from the process descriptor block.

  Operating systems to be configured

company wants to upgrade the computers they have by adding another internal hard drive and preparing it for use. How do you explain how to do this and the options that the company has?

  Friendly computer program

Consider of any computer related item that you felt was not user friendly to you? Did you feel reluctant to continue using it.

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