Well I am trying to make a program in which I have a user input two test scores then the program uses this formula to give me a score:
score = (pointsEarned/pointsPossible) * 100
I am lost in what else to do in my code and wondering if someone could help me with my missing parts.
#include <iostream>
using namespace std;
void getInput(int &pointsEarned, int &pointsPossible);
void printOutput(int score);
const int pointPossible = 200;
void main()
{
int pointsEarned, pointsPossible;
float score;
getInput(pointsEarned, pointsPossible);
//enter code to call the function getInput
score = (pointsEarned/pointsPossible) * 100;
printOutput(score);
}
void getInput(int &pointsEarned, int &pointsPossible)
{
int test1, test2;
cout << "Enter first test score:\n";
cin >> test1;
cout << "Enter second test score:\n";
cin >> test2;
//enter code to request two test scores from the user.
//Store these values in pointsEarned and pointsPossible.
}
void printOutput(int score)
{
cout << "The student's score is " << score;
}
Question
YounGMessiah
Well I am trying to make a program in which I have a user input two test scores then the program uses this formula to give me a score:
score = (pointsEarned/pointsPossible) * 100
I am lost in what else to do in my code and wondering if someone could help me with my missing parts.
#include <iostream> using namespace std; void getInput(int &pointsEarned, int &pointsPossible); void printOutput(int score); const int pointPossible = 200; void main() { int pointsEarned, pointsPossible; float score; getInput(pointsEarned, pointsPossible); //enter code to call the function getInput score = (pointsEarned/pointsPossible) * 100; printOutput(score); } void getInput(int &pointsEarned, int &pointsPossible) { int test1, test2; cout << "Enter first test score:\n"; cin >> test1; cout << "Enter second test score:\n"; cin >> test2; //enter code to request two test scores from the user. //Store these values in pointsEarned and pointsPossible. } void printOutput(int score) { cout << "The student's score is " << score; }Link to comment
Share on other sites
14 answers to this question
Recommended Posts