OVERVIEW You will 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. INSTRUCTIONS 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. 1. Use the Lab Template you set-up last week to function as the foundation of your program. 2. Add the variables & math computations necessary to complete the calculations. Make sure you use the ceil function in the header file. 3. The input to the program must come from an external data file that you create. You will create a text file. The file will contain a single line with the score and total separated by a space. 4. Display the floating-point result up to 5 decimal places. Output the results to the screen. The output must be labeled clearly and formatted neatly. 5. Include proper formatting, and appropriate comments in your code. 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 "Eail" if the grade is less than 60
(C++ Programming)
Here's the foundation/Lab Template below. Please follow the directions and base the finished code off this. Thanks.
#include <iostream>
using namespace std;
double factorial(int num);
int main()
{
//variable declaration
double n, r, temp, nfact, rfact, tempfact, ans;
//In cout statement below substitute your name
cout << "First Name" << endl << endl;
//taking inputs from user
cout << "Enter the value of n:";
cin >> n;
cout << "\nEnter the value of r:";
cin >> r;
temp = n - r;
//finding factorial by calling factorial function
nfact = factorial(n);
rfact = factorial(r);
tempfact = factorial(temp);
ans = nfact / (rfact * tempfact);
cout << "\nAnswer = " << ans;
return 0;
}
//function to find factorial
double factorial(int num) {
if (num == 0 || num == 1) {
return 1;
}
else {
return (num * factorial(num - 1));
}
}
![OVERVIEW
You will 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.
INSTRUCTIONS
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.
1. Use the Lab Template you set-up last week to function as the foundation of your program.
2. Add the variables & math computations necessary to complete the calculations. Make sure
you use the ceil function in the <cmath> header file.
3. The input to the program must come from an external data file that you create. You will
create a text file. The file will contain a single line with the score and total separated by a space.
4. Display the floating-point result up to 5 decimal places. Output the results to the screen. The
output must be labeled clearly and formatted neatly.
5. Include proper formatting, and appropriate comments in your code.
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F63c72e0d-d7e9-45e3-b52c-72ad82d50136%2Fdbfa8113-d9c3-49b7-80d4-dbb679680f6b%2F1rr9dq7_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)