Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include using namespace std; int main() { int input; cout cin >> input; switch (input) { // Complete this switch statement in C++ }

image text in transcribed

#include

#include

using namespace std;

int main() {

int input;

cout

cin >> input;

switch (input) {

// Complete this switch statement in C++

}

return 0;

}

You will write a program that uses a switch statement. First, have the user enter an integer as prompted below. If the number is 0 1, or 2 you should printNumber less than three if the number entered is , you should print "Number is three". If the number is 4,5, or 6, you should print "Number between three and seven If the number entered is 7 you should print, "Number is seven". For any other integer input your program should print, "Number outside of range", You should use as few cout statements as possible by carefully ordering your case statements within the switch and thinking about where to put "break" statemens, The Number outside of range cout statement should be in the default case of the switch statement. 1 point will be deducted for not using default properly, and 2 points will be deducted for having multiple cout statements that print the same thing. You must use a switch statement and will receive no credit if you use an if/else construct. Note that part of the code is started for you already Sample run 1 Enter a number 1ess than 8:1 Number less than three Sample run 2: Enter a number less than 8: 7 Number is seven

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

List the advantages and disadvantages of the pay programs. page 505

Answered: 1 week ago