Question

In: Computer Science

Please use a switch statement to tell the user that his work is great, good, satisfactory,...

Please use a switch statement to tell the user that his work is great, good, satisfactory, or he barley passed based on his grade (A : great work, B : good, C: satisfactory, D: Barley passed) This program must be in C++ and must be able to run.

Thank you and I hope you have a great day!

Solutions

Expert Solution

#include<iostream>
using namespace std;
int main()
{
   char grade;
   cout<<" A,B,C,D enter you grade from this options"<<endl;
   scanf("%c",&grade);
   switch(grade) //grade contains input from user switch statment matches that input with given cases, case which is match is gegts executed
   {
      case 'A': cout<<"great work"<<endl;
             break;
      case 'B':cout<<"good "<<endl;
             break;
      case 'C':cout<<"Satisfactory"<<endl;
             break;
      case 'D':cout<<"Barley passed"<<endl;
             break;
      default:
             cout<<"please enter correct grade";//if grade is other than A,B,C,D
             break;
     }
     return 0;
}


Related Solutions

Please review “The World of Work.” What are your own plans for achieving a satisfactory work–life...
Please review “The World of Work.” What are your own plans for achieving a satisfactory work–life balance after graduating from college? Based on the research in this section, how realistic do you think your goals are?
Write a program using switch statement that asks user to enter the month number and then...
Write a program using switch statement that asks user to enter the month number and then it prints out the number of days for that month. For simplicity reasons have your program print 28 days for February no matter if it is a leap year or not. Your program should also handle any invalid month numbers that user could enter (hint use default for the switch). Use a while loop to allow user to test for different month entries till...
Python #Use an input statement to ask the user for his/her age (no prompt) and assign...
Python #Use an input statement to ask the user for his/her age (no prompt) and assign the user entry to a variable #Convert the user input to an integer and assign to a variable #Write if-elif-else statements with the following conditions and actions #Important: For each Action below, use the same variable name for the rating in all the if, elif, and else statements #Condition: user input less than or equal to 9 Action: assign the letter G as a...
Write a program using the switch statement to calculate geometric quantities. Prompt the user to enter...
Write a program using the switch statement to calculate geometric quantities. Prompt the user to enter a radius. Then present a menu of choices for quantities to be calculated from that radius:                         A         Area of a Circle                         C         Circumference of a Circle                         S          Surface Area of a Sphere                         V         Volume of a Sphere Prompt the user to enter the character corresponding to the quantity to be calculated. Use a switch statement to handle the calculations. Use...
Use a switch statement to write a function that returns TRUE if a character is a...
Use a switch statement to write a function that returns TRUE if a character is a consonant and returns FALSE otherwise.
Add logic to tell me to switch to unlimited if I go over $75. Use C++...
Add logic to tell me to switch to unlimited if I go over $75. Use C++ /******************************************************************************* ** Program Name: Verizons Monthly Bill Calculator. ** File Name: file a03.cpp. ** Author: Natassha Quiroz ** Date: October 18, 2020 (updated 10/20/20) ** Assignment: 03 ** Description: The purpose of this program is to calculate the consumers monthly cell ** phone bill based on data usage. ** Sources: Lecture slides, lecture videos and practice programs from lecture video. *******************************************************************************/ #include <iostream> #include...
please give me a summary about the company Stryker. Please tell me the good and bad...
please give me a summary about the company Stryker. Please tell me the good and bad about Stryker and why they are important.
ASAP PLEASE Problem Statement A car dealer wants to use a software to display his or...
ASAP PLEASE Problem Statement A car dealer wants to use a software to display his or her cars’ information. As a software developer, you are going to develop a simple program for the dealer. You will have a Car class which has the following member variables:  Car’s Brand  Car’s Color  Car’s MPG (Mile Per Gallon) This class has setters and getter for all member variables. This class has four different constructors: 1. A constructor with no argument....
please give me a summary about Boeing company. please tell me why Boeing is good and...
please give me a summary about Boeing company. please tell me why Boeing is good and bad and why they are important.
PLEASE TELL ME HOW TO GET TO THESE ANSWERS AND SHOW WORK. Below is the shareholders’...
PLEASE TELL ME HOW TO GET TO THESE ANSWERS AND SHOW WORK. Below is the shareholders’ equity section of Matt Co.’s balance sheet for December 31, 2018 and December 31, 2017. Matt uses the treasury stock method to account for repurchases. During 2017, Matt repurchased 1,000 shares at $10 per share. December 31, 2018 December 31, 2017 Common Stock (par value $0.01) 120 100 Paid-in Capital, in excess of par 189,880 149,900 Paid-in Capital, share repurchase 3,200 0 Treasury Stock...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT