Remove the break statements from each of the cases

Assignment Help Business Management
Reference no: EM132247899

How do you add an additional switch statement? i tried multiple times and i'm not sure if i don't understand braces enough but it didn't seem doable. also, I'm not sure what the teacher wants me to submit. This the problem. I'm not sure my code is right or wrong. Please someone explain to me this step by step.

This lab lets students work with the switch statement.

  • Remove the break statements from each of the cases. What is the effect on the execution of the program?
  • Add an additional switch statement that allows for a Passing option for a grade of D or better. Use the sample run given below to model your output.

Sample Run: What grade did you earn in Programming I? 

YOU PASSED!  An A - excellent work!

The following is the code to be used:

// This program illustrates the use of the Switch statement.

// PLACE YOUR NAME HERE

#include <iostream>

using namespace std;

int main()

{

char grade;

cout << "What grade did you earn in Programming I ?" << endl;

cin >> grade;

switch( grade ) // This is where the switch statement begins

{

    case 'A': cout << "an A - excellent work !" << endl;

    break;

    case 'B': cout << "you got a B - good job" << endl;

    break;

    case 'C': cout << "earning a C is satisfactory" << endl;

    break;

    case 'D': cout << "while D is passing, there is a problem" << endl;

    break;           

    case 'F': cout << "you failed - better luck next time" << endl;      

    break; 

    default: cout << "You did not enter an A, B, C, D, or F" << endl;

}

return 0;

}

This is my code

#include <iostream>

using namespace std;

int main()

{

char grade;

cout << "What grade did you earn in Programming I ?" << endl;

cin >> grade;

switch( grade )

{

   case 'A': cout << " You Passed! " << endl;

   break;

   case 'B': cout << " You got a B - Good Job! " << endl;

   break;

   case 'C': cout << " Earning a C is satisfactory" << endl;

   break;

   case 'D': cout << " while D is passing, there is a problem " << endl;

   break;

   case 'F': cout << " You failed " << endl;

   break;

   default: cout << "You did not enter an A, B, C, D, or F" << endl;

}

return 0;

}

Reference no: EM132247899

Questions Cloud

Why are the commit and rollback statements necessary : Explain their relationship to one of the transaction properties. Explain all four possible concurrency problems and provide examples of each.
What is e-supply chain management : What is e-supply chain management? Its advantages and disadvantages, benefits and some real world examples. 3. Explain how firms signal their intention to coop
Define what a treaty is-the types of treaties : Define what a treaty is, the types of treaties, and why they are significant.
Describe psychological consequences of childhood obesity : This discussion is in regards to the long-term physical and psychological consequences of childhood obesity. There are documented morbidity and mortality rates.
Remove the break statements from each of the cases : Remove the break statements from each of the cases. What is the effect on the execution of the program?
Do we spend money rationally : What's the difference between a budget, and the process of budgeting? What's more important?
How will you apply the information in your intended career : In your post, comment on the most valuable information you learned and why it was valuable. How will you apply this information in your intended career?
Preemptive measures be taken against terrorists : In your opinion, when should preemptive measures be taken against terrorists?
Describe the portions of singer article you seek to engage : Describe the portions of Singer's article you seek to engage/critique. Remember, the nature of the stance is not important; you can agree or disagree.

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd