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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

(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.
Transcribed Image Text: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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY