Hello all,
I am creating a program, and I am currently stuck. I need someone to guide me on track on what I am doing wrong. My main goal is to get the program to run. I can't even do that. My C++ code is provided below. Thanks for all who helps.
Directions: Write a C++ computer program to compute the grades (assignment scores,lab scores,test scores, final exam score) and find the final grade of what an individual would receive in the class. You must use functions and atleast one must be a value-returning function.
Here is my code:
#include <iostream>
#include <iomanip>
using namespace std;
void testpoints();
void labpoints();
void projectpoints();
void finalpoints();
void finalgrade(double& testpoints, double& labpoints, double& projectpoints,
double& finalpoints);
void printresults (double testpoints, double labpoints, double projectpoints,
double finalpoints);
int main ()
{
cout<<fixed<<showpoint;
cout.precision(2);
double testpoints;
double labpoints;
double projectpoints;
double finalpoints;
gettestscores();
getlabscores();
getprojectscores();
getfinalexamscores();
getfinalgrade(testpoints,labpoints,projectpoints,finalpoints);
printresults(testpoints,labpoints,finalpoints,projectpoints,finalgrade);
system ("PAUSE");
return 0;
}
double gettestscores ()
{
int numtest;
double gettestscores
double testscores;
double average;
double sum = 0;
cout<<"How many test did you take? "<<endl;
cin>>numtest;
for (int i=1; i<=numtest; i++)
{
cout<<"Enter scores for tests? "<<i<<endl;
cin>>testscores;
sum+=testscores;
}
}
double getlabscores ()
{
int numlab;
double labscores;
double average;
double sum = 0;
cout<<"How many labs did you take? "<<endl;
cin>>numlab;
for (int i=1; i<=numlab; i++)
{
cout<<"Enter scores for labs? "<<i<<endl;
cin>>labscores;
sum+=labscores;
}
}
double getprojectscores ()
{
int numtest;
double projectscores;
double average;
double sum = 0;
cout<<"How many projects did you take? "<<endl;
cin>>numproject;
for (int i=1; i<=numproject; i++)
{
cout<<"Enter scores for project? "<<i<<endl;
cin>>projectscores;
sum+=projectscores;
}
}
double getfinalexamscores ()
{
int numfinalexam;
double finalexamscores;
double average;
double sum = 0;
cout<<"How many final exams did you take? "<<endl;
cin>>numfinalexam;
for (int i=1; i<=numfinalexam; i++)
{
cout<<"Enter score for final exam? "<<i<<endl;
cin>>finalexamscores;
sum+=finalexamscores;
}
}