5 decimal places in code

Trying to get decimal places in grades, along with regular grades, not sure how to do it. Please help. Here is my code so far.

#include <iostream>
#include <cmath>
#include <fstream>
#include <iomanip>

using namespace std;

int main ()

{
//input variables
float NumberRight;
float TotalPoints;
float GradePercent;
float grade = 100;
float Score = 100;




ifstream inData;

// open file
inData.open ("grades.txt");


// read values
inData >> NumberRight >> TotalPoints;


//calculate values

GradePercent = NumberRight / TotalPoints;

cout << "You got an ";


if (GradePercent > 90)

cout << "Excellent" << endl;


if (GradePercent > 80)

cout << "Great work" << endl;

if (GradePercent > 70)

cout << "Could be better" << endl;

if (GradePercent >= 60)

cout << "Needs Improvement" << endl;

else (GradePercent < 50);

cout << "Fail" << endl;

system ("pause");
return 0;
}
Topic archived. No new replies allowed.