I really need help with this, i have way to much to do and i am just lost on how to write this program if anyone can help.
Function Format
Purpose
To create and execute a C++ program with functions to read student name and scores
input from a keyboard, calculate the test average, program average, course average, and
the letter grade earned and output the result to the monitor as well as to an output text
file. Program must allow grades to be calculated for one or more number of students.
The letter grade earned must be based on the course average (the average of the program
and test scores) as shown below.
Course Average Letter Grade
>=90% A
80% - 89% B
70% - 79% C
Below 70% F
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 not less than 0 or greater than 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)
this is what i have so far
#include<iostream>
#include<iomanip>
#include<fstream>
using namespace std;
//Global variables/constants, function prototypes
void headerfn();//void function with no parameters
void inputfn(string &fname, string &lname, int &prog1, int &prog2, int &prog3, int &test1, int &test2, int &test3);
float inputfn(string input);
char gradefn(float avg);
void outputfn(float avg, char grade);
int main(){
system("color f0");
headerfn();//void function call
//************************************************************
//Void Function Without Parameters
void headerfn(){
cout<<"123456789012345678901234567890123456789012345678901234567890"<<endl;
cout<<setw(60)<<setfill('*')<<"*"<<endl;
cout<<"* *";
cout<<"* information from the keyboard and outputs *";
cout<<"* the results to the monitor and a text file. *";
cout<<setw(60)<<setfill('*')<<"*"<<endl;
}//end of headerfn
//************************************************************
//Void Function With Parameters
void inputfn(string &fname, string &lname, int &prog1, int &prog2, int &prog3, int &test1, int &test2, int &test3){
void namefn(string &fname, string &lname){
cout<<" Enter your first and last name: ";
cin>> fname>>lname;
}
cout<<"Please enter the first program score: ";
cin>>prog1;
cout<<"Please enter the second program score: ";
cin>>prog2;
cout<<"Please enter the third program score: ";
cin>>prog3;
cout<<"Please enter the first test score: ";
cin>>test1;
cout<<"Please enter the second test score: ";
cin>>test2;
cout<<"Please enter the third test score: ";
cin>>test3;
cout<<fixed<<showpoint<<setprecision(2);
average=(test1+test2+test3)/3;
cout<<"Average: "<<average<<endl;
//************************************************************
//Value Returning Function With Parameter
float inputfn(string &fname, string &lname, int &prog1, int &prog2, int &prog3,int &test1, int &test2, int &test3){
float input;
if (input<0) cout<<"This score is invalid! PLease enter a score between 0-100: ";
else if (input>100) cout<<"This score is invalid! PLease enter a score between 0-100: ";
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
usingnamespace 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;
}