You are required to use a function to accomplish each of the following: 1. Outpu
ID: 3537880 • Letter: Y
Question
You are required to use a function to accomplish each of the following:
1. Output descriptive header (void function with no parameters)
2. Prompt user for name and program/test scores and read the input (void function with reference parameters)
3. Check to ensure each input score is within range (0-100). Prompt user to reenter score if not within specified range (value returning function with parameter)
4. Calculate averages (void function with value and reference parameters)
5. Assign letter grade (value returning function with parameter)
6. Output student name, total points, and program, test, and course averages to monitor and text file. (void function with value parameters) Note: You must check for file output stream failure.
Program Input
The input from a keyboard must consist of the following information for any student:
Explanation / Answer
#include <fstream> #include <iostream> #include <stdlib.h> #include <stdio.h> #include <string.h> using namespace std; void Header() { cout << "1. Output descriptive header (void function with no parameters)" << endl; } void UserInput() { cout << "2. Prompt user for name and program/test scores and read the input (void function with reference parameters)" << endl; } void CheckValues() { cout << "3. Check to ensure each input score is not less than 0 or greater than 100. Prompt user to" << endl; cout << "reenter score if not within specified range (value returning function with parameter)" << endl; } void CalculateAverages() { cout << "4. Calculate averages (void function with value and reference parameters)" << endl; } void AssignGrade() { cout << "5. Assign letter grade (value returning function with parameter)" << endl; } void OutPut() { cout << "6. Output student name, total points, and program, test, and course averages to monitor " << endl; cout << "and text file. (void function with value parameters)" << endl; } int main() { Header(); UserInput(); CheckValues(); CalculateAverages(); AssignGrade(); OutPut(); return 0; }
#include <fstream> #include <iostream> #include <stdlib.h> #include <stdio.h> #include <string.h> using namespace std; void Header() { cout << "1. Output descriptive header (void function with no parameters)" << endl; } void UserInput() { cout << "2. Prompt user for name and program/test scores and read the input (void function with reference parameters)" << endl; } void CheckValues() { cout << "3. Check to ensure each input score is not less than 0 or greater than 100. Prompt user to" << endl; cout << "reenter score if not within specified range (value returning function with parameter)" << endl; } void CalculateAverages() { cout << "4. Calculate averages (void function with value and reference parameters)" << endl; } void AssignGrade() { cout << "5. Assign letter grade (value returning function with parameter)" << endl; } void OutPut() { cout << "6. Output student name, total points, and program, test, and course averages to monitor " << endl; cout << "and text file. (void function with value parameters)" << endl; } int main() { Header(); UserInput(); CheckValues(); CalculateAverages(); AssignGrade(); OutPut(); return 0; }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.