Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

My assignment is to use a switch statement to solve: Create two void functions titled getScore and printGrade with an int argument. The function getScore

My assignment is to use a switch statement to solve:

Create two void functions titled getScore and printGrade with an int argument. The function getScore should have a Reference parameter and printGrade should have a Value parameter.The function getScore will prompt the user for the numerical score, get the input from the user, and print the numerical score. The function printGrade will calculate the course grade and print the course grade. (Be careful and note that the assignment requires you to input the grade into getScore and not directly into the main function.)

The issue is that my code is not giving the correct letter grade

#include #include using namespace std; int score; void getScore(); void printGrade();

void getScore() { cout <<"Please enter your numerical score and your grade will be display "; cin >> score ; cout << "You entered a score of " <

void printGrade() { switch (score) { case 'A': score >= 90; cout << "Your Grade is: A " <= 80; cout << "Your Grade is: B "<= 70; cout << "Your Grade is: C "<= 60; cout << "Your Grade is: D "<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel 2024 In 7 Days

Authors: Alan Dinkins

1st Edition

B0CJ3X98XK, 979-8861224000

More Books

Students also viewed these Databases questions

Question

LOQ 13-9: How can group interaction enable group polarization?

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

What are the challenges associated with tunneling in urban areas?

Answered: 1 week ago