Explore BrainMass
Share

Explore BrainMass

    Convert the following switch statement into if/else if statement:

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Switch (choice)
    {
    case 1:
    cout << fixed << showpoint << setprecision(2);
    break;
    case 2:
    case 3:
    cout << fixed << showpoint << setprecision(4);
    break;
    case 4:
    cout << fixed << showpoint << setprecision(6);
    break;
    default:
    cout << fixed << showpoint << setprecision(8);
    }

    © BrainMass Inc. brainmass.com October 9, 2019, 10:49 pm ad1c9bdddf
    https://brainmass.com/computer-science/software-development/convert-following-switch-statement-into-statement-233161

    Solution Preview

    if (choice == 1)
    {
    cout << fixed << showpoint << setprecision(2);
    ...

    Solution Summary

    The expert converts a switch statement into if/else if statements.

    $2.19