#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
#include <conio.h>
#include <iomanip>
#include <math.h>
#include <Windows.h>
usingnamespace std;
int getScore()
{
system ("color 1f");
int score = 0;
char name, grade;
//input score
cout << "Enter score: ";
cin >> score;
cout << "Enter name: ";
cin >> name;
if (score == 100)
{
cout <<"You received a perfect score (A*) Did You Cheat lol \n";
// 100% is an A. BrainBox
}
elseif ((score >= 85) && (score <= 100))
{
cout << "Your grade is an (A*).\t Great Stuff ! \n";
// 85-100 is an A*.
}
elseif ((score >= 70) && (score <= 84))
{
cout << "Your grade is a just an (A).\t Well done. \n";
// 70-84 is a A.
}
elseif ((score >= 55) && (score <= 69))
{
cout << "Your grade is a (B).\t Not Bad ? \n";
// 55-69 is a B.
}
elseif ((score >= 40) && (score <= 54))
{
cout << "Your grade is a (C).\t Still a pass tho . \n";
// 40-54 is a C.
}
elseif ((score >= 0) && (score <= 39))
{
cout << "You got an F!\t YOU FAIL! GO JOIN THE DOLE QUEUE. \n";
// 0-39 is an F.FAIL
}
_getch();
return 0;
}
it would depend on what type of loop you would want. you can put it into a loop to run as many times as you want till you tell it to quit, or have it run a certain number of runs. I would use a while loop. pretty much it would go like this.
int score = 0;
char name,grade;
while( grade != '.')
{
your program you already have