Question: // Switch wont return a value #include #include using namespace std; int main() { int realNumber, choice; // screen I/O cout < < Please enter

// Switch wont return a value

#include

#include

using namespace std;

int main()

{

int realNumber, choice;

// screen I/O

cout << "Please enter a Real number: ";

cin >> realNumber;

cout << "Choose your rounding method: ";

cout << "1. Floor round ";

cout << "2. Ceiling round ";

cout << "3. Round to the nearest whole number ";

cin >> choice;

switch (choice)

{

case 1: cout << floor(realNumber);

break;

case 2: cout << ceil(realNumber);

break;

case 3: cout << round(realNumber);

break;

default: cout << endl;

}

return 0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!