Program to calculate numeric grades for a course

Assignment Help Operating System
Reference no: EM1379742

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:

Create a program to calculate numeric grades for a course. The course records are in a document that will serve as the input document. 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: EM1379742

Questions Cloud

Are following objective functions for an lp model equivalent : Are following objective functions for an LP model equivalent. That is, if they are both used, one at a time, to solve a problem with exactly same constraints, will optimal values of X1 also X2 be same in both cases.
Combining global variables and functions : The parameter list is the normal means to supply values to a function. Global variables are an alternate means for a function to have access to values.
What is core competency of nike : Compare strengths, weaknesses, opportunities also threats of Nike to its competitors. How vision does also values affect how company will respond to each.
Are they keeping also attracting top talent : Are they keeping also attracting top talent. Are there hiring increases or loss of key employees, etc.
Program to calculate numeric grades for a course : Create a program to calculate numeric grades for a course. The course records are in a document that will serve as the input document.
Which method shuz world should use for manufacturing : Shuz world should use for manufacturing of its sneakers, utilizing appropriate decision analysis tool. Which method Shuz world should use for manufacturing.
Software faults - windows xp : Analysis shows that there are about five faults per 1000 lines of code in carefully made programs, which means that one million lines of codes will have 5000 faults.
Explain training equity also glass ceiling : Explain training equity also glass ceiling also then analyze how these terms related to Ms. Conner. Analyze issues that Ms. Conner dealt with also suggests ways that these issues could have been avoided or mended.
Show possible interleavings of the execution : A concurrent program with 2-procedure, p and q, defined as follows, A,B,C,D, and E are arbitrary atomic statements. Suppose that the main program does a parbegin of the two procedure.

Reviews

Write a Review

Operating System Questions & Answers

  Construct resource allocation graph with processers

Construct a resource allocation graph with the following processers and resources, the system consists of four processers P1, P2, P3, and P4 and five resources R1, R2, R3, R4, and R5.

  How many page faults are generated array-initialization loop

Illustrate how many page faults are generated by following array-initialization loops, using LRU replacement, and assuming page frame 1 has process in it, and the other two are initially empty?

  Process customer order history from a file

Required help creating a document that Develop an application that will read and procedure customer history order information from a document.

  Solving operating system problem

Assume a time sharing operating system allocated time slices of twenty milliseconds and the machine executed an average of 5000 instructions per microsecond.

  Overview of multiprogramming mode

Member of coordinating a computer's activities is handling failure. This is called fault tolerance. Briefly explain about how a computer handles loss of power to limit the loss of all work

  Designing and coding

Prepare a database with a table called tblNames and tbl Login. The tbl Names table should have the following columns.

  Describe function of operating system

Determine the functions that an operating system provides to make a computer run. Describe why that is an important feature and what an OS requires to be aware of to provide that service.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Discuss and provide examples of mutual exclusion

Discuss and provide examples of the following concurrency issues associated with an OS: 1. Mutual exclusion 2. Deadlock 3. Starvation

  Creating hipo charts and decision tables

Now that you have a program design and a selected programming language for your assignment, you can start looking at the logical flow of the processes within your program and the data that is input,

  Data abstraction for health it applications

Choose one database design model and discuss the benefits that model would bring to health information technology applications.

  One page document describing security

Analyze the Internet and construct a one page document describing how security is maintained while transacting business over the Internet.

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