Explore BrainMass

Explore BrainMass

    CLS on heads or tails program

    Not what you're looking for? Search our solutions OR ask your own Custom question.

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

    I also need to fill in the missing part of the code
    In MS-DOS, the command to clear the screen is cls; in UNIX, it is clear. Try the command so that you understand its effect. Modify the heads_or_tails program so that the screen is cleared at the beginning of the program. Use the function call system ("cls") or system ("clear") to accomplish this. What happens when the output is redirected? Is the screen still cleared?

    #include "heads_or_tails.h"
    void report_a_win (int coin)
    {
    printf("You win, it was a");
    if coin
    {
    printf ("tailn");
    }
    else
    {
    printf ("headn");
    }
    return;
    }
    void report_a_loss (int coin)
    {printf("You lose, is was a");
    if (coin)
    {printf("tailn");
    }
    else
    {printf("headn);
    }
    return
    }

    © BrainMass Inc. brainmass.com March 4, 2021, 8:03 pm ad1c9bdddf
    https://brainmass.com/computer-science/algorithms/cls-heads-tails-program-141931

    Solution Summary

    Create function call to clear the screen at the beginning of the program.

    $2.49

    ADVERTISEMENT