# Hello good afternoon,This is my first time using Bartleby, I am super slow in computer science and I am wondering if you please can help me to be very specific and explanative as possible with the following problem. to be honest, I don't even know how to start.Write a C++ program that computes a student’s grade for an assignment as a percentage given the student’s score and total points. The final score must be rounded up to the nearest whole value using the ceil function in the header file. You must also display the floating-point result of up to 5 decimal places. The input to the program must come from a file containing a single line with the score and total separated by a space.In addition, you must print to the console “Excellent” if the grade is greater than or equal to 90, “Well Done” if the grade is less than 90 and greater than or equal to 80, “Good” if the grade is less than 80 and greater than or equal to 70, “Need Improvement” if the grade is less than 70 and greater than or equal to 60, and “Fail” if the grade is less than 60.

Question
333 views

Hello good afternoon,

This is my first time using Bartleby, I am super slow in computer science and I am wondering if you please can help me to be very specific and explanative as possible with the following problem. to be honest, I don't even know how to start.

Write a C++ program that computes a student’s grade for an assignment as a percentage given the student’s score and total points. The final score must be rounded up to the nearest whole value using the ceil function in the header file. You must also display the floating-point result of up to 5 decimal places. The input to the program must come from a file containing a single line with the score and total separated by a space.

In addition, you must print to the console “Excellent” if the grade is greater than or equal to 90, “Well Done” if the grade is less than 90 and greater than or equal to 80, “Good” if the grade is less than 80 and greater than or equal to 70, “Need Improvement” if the grade is less than 70 and greater than or equal to 60, and “Fail” if the grade is less than 60.

check_circle

Step 1

Program instructions:

• Declare necessary variables.
• Open the file with the score and total points and read the data.
• Calculate the percentage and use ceil() function to round up the score from the file.
• Use printf() function to print the floating point result up to 5-decimal places as well.
• Use if-else statements to print the message with the grade.
Step 2

Program:

#include <iostream>

#include <cmath>

#include <fstream>

#include <iomanip>

using namespace std;

int main ()

{

//input variables

float score;

float TotalPoints;

ifstream inData;

// open file

inData >> score >> TotalPoints;

//calculate percentage

GradePercent = ceil(score) / TotalPoints * 100;

// print the results

cout << "You got "<<GradePercent<<"% ";

cout<<" ";

// assign and print the grades

{

cout<< "Excellent"<<endl;

}

{

cout<< "Well Done"<<endl;

}

{

cout<< "Good"<< endl;

}

{

cout<< "Need Improvement"<< endl;

}

{

cout<< "Fail"<< endl;

}

return 0;

}

Step 3

...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

### Computer Science 