Description: The purpose of this lab is to develop your programming skills and introduce functions. Write a program that simulates flipping a coin and rolling a dice.

A user will input their choice of flipping a coin (C), rolling a dice (D), or exiting (E).

If the user chooses a coin toss, the program will ask how many times the coin should be tossed, then will simulate tossing the coin that many times and print the result to the user.

If the user chooses rolling a die, the program will ask how many sides the die has and how many times it should be rolled. The program will then simulate rolling a die (with the number of sides specified) that many times.

The program will continue until the user presses E.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.