Question

1. Create a program that takes a numerical score and outputs a letter grade. 2. In...

1. Create a program that takes a numerical score and outputs a letter grade.

2. In this program, create two void functions titled makeScore and theGrade with an int argument.

3. The function makeScore should have a Reference parameter and theGrade should have a Value parameter.

Note: Specific numerical scores and letter grades are listed below:

90-100

=

Grade A

80-89

=

Grade B

70-79

=

Grade C

60-69

=

Grade D

0-59

=

Grade F

4. The function makeScore will prompt the user for the numerical score, get the input from the user, and print the numerical score.

5. The function theGrade will calculate the course grade and print the course grade.

6. Input the grade into makeScore and not directly into the main function.

7. Utilize the switch statement in this program.

Note: This is a C++ Program.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:-

#include<iostream>
using namespace std;
void makescore(int &num);
void makescore(int &num)
{
   
    cout << "Your Numberical Score is :"<< num <<endl;
   
   
}
void theGrade(int num)
{
    int num2=num/10;
    string grade;
    switch(num2)
    {
        case 0:
            case 1:
                case 2:
                    case 3:
                        case 4:
                            case 5:
                                cout << "your grade is F" << endl;;
                                break;
                                case 6:
                                    cout << "your grade is D" << endl;;
                                break;
                                    case 7:
                                    cout << "your grade is C" << endl;;
                                break;
                                    case 8:
                                    cout << "your grade is B" << endl;;
                                break;
                                    case 9:
                                    cout << "your grade is A" << endl;;
                                break;
                                    case 10:
                                    cout << "your grade is A" << endl;;
                                break;
                               
                                   
    }
}



int main()
{ int number;
cout << "Please Enter Your Marks :" << endl;
    cin >> number;
    makescore(number);
    theGrade(number);
    return 0;
}

Output:-

Compiler - Dev C++

Add a comment
Know the answer?
Add Answer to:
1. Create a program that takes a numerical score and outputs a letter grade. 2. In...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ program that will provide a user with a grade range if they enter...

    Write a C++ program that will provide a user with a grade range if they enter a letter grade. Your program should contain one function. Your function will accept one argument of type char and will not return anything (the return type will be void), but rather print statements to the console. Your main function will contain code to prompt the user to enter a letter grade. It will pass the letter grade entered by the user to your function....

  • Create a MIPS program that does the following: 4. Determine the letter grade a. Use the...

    Create a MIPS program that does the following: 4. Determine the letter grade a. Use the floating point calculated average to determine the letter grade. You will need to research the instructions to use to do comparisons with floating point numbers. (see Course Resources) b. Use the following chart: 90 - 100 80 - 89 70 - 79 ............. 60 - 69.............. <60 ..................... ............... 5. Display a message and the letter grade. 6. Your output should look similar to...

  • Write a program that will calculate your letter grade at the end of the semester for...

    Write a program that will calculate your letter grade at the end of the semester for CSIS130. Your program will read an input file that shall contain all the tests scores and lab scores for the semester, and the input file data should be in the following format: full name of student Test1 Score (0…100), Test2 Score (0..100) , Final Exam Score (0..100), Total Number of Labs: N NLab Scores (0=Fail, 1=Pass) [You will have N lab scores each separated...

  • [Using Python] Use the grade scale in the syllabus for this class, write a program that...

    [Using Python] Use the grade scale in the syllabus for this class, write a program that inputs a score, and prints the grade for that score. For example, if I input 90.0, your program should print A. Grading Scale is: 100% - 90% A 89% - 80% B 79% - 70% C 69% - 60% D 59% - 0% E

  • We want to create a program which prints off what letter grade an individual receives based...

    We want to create a program which prints off what letter grade an individual receives based upon whether or not their grade obeys the following condition: grade>= 90 and grade = 80 and grade<89, we will print off “You made a B”, so on and so forth. In this program, we can assume that we are asking the user to enter whatever grade they recieved as a numeric input. NEED HELP WITH ALL PARTS! 4.) Consider the example of grades...

  • Python: Create a simple program that calls a function call gradeCalculated, in the main area the...

    Python: Create a simple program that calls a function call gradeCalculated, in the main area the user is asked to enter their grade from 0-100. Pass in the number grade via a parameter into the function, based on their grade tell the user what letter grade they got as a letter grade and number and then tell me a quote how you feel about your grade. 90+ A 80-89 B 70-79 C 60-69 D Below 60 F

  • Write a program that asks the user to enter five test scores. The program should display...

    Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Score Letter Grade...

  • SOLVE IN PYTHON:Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes...

    SOLVE IN PYTHON:Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array....

  • Java program Program: Grade Stats In this program you will create a utility to calculate and...

    Java program Program: Grade Stats In this program you will create a utility to calculate and display various statistics about the grades of a class. In particular, you will read a CSV file (comma separated value) that stores the grades for a class, and then print out various statistics, either for the whole class, individual assignments, or individual students Things you will learn Robustly parsing simple text files Defining your own objects and using them in a program Handling multiple...

  • In Python In this programming assignment, you will do multiple programming exercises, and eventually develop a...

    In Python In this programming assignment, you will do multiple programming exercises, and eventually develop a Python application that can calculate student course grades. (6 points) Write a program called p2-1.py to: (1) create a list and add integer numbers from 1 to 100 to the list; (2) calculate the average value of all numbers in the list; and (3) print the result (screenshots). (8 points) Write a program called p2-2.py to: (1) allow a user to define how many...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT