Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this exercise, you need to compute the shared cash prize when given a total prize pool and the number of winners. Your program is
For this exercise, you need to compute the shared cash prize when given a total prize pool and the number of winners. Your program is going to be used by the New Zealand Lotteries Commission to compute how much each Lotto player should win when the total prize pool and the number ofwinners is known. The total prize pool should be divided evenly amongst the winners. The output of your program should be a dollar value expressed to 2 decimal places. The example below illustrates how your program should work in the case that there are 3 winners sharing a total of $1001. The example shows how the prompts and the output for your program must be formatted {user input is shown in red and bold]: Total: 1061 winners: 3 Shared: $333.67 N otes: - there should be a newline printed after each prompt to the user {i.e. after "Total:" and "Winners'.") 0 both the cash total and the number of winners are entered as whole numbers a you can assume there will be at least one winner! a the output. which displays the shared prize per winner, must show exactly 2 decimal places and display the currency symbol (Le. dollar sign] For example: Input Result 1991 Total: 3 winners: Shared: $333.5? 1989669 Total: 4 winners: Shared: $256699.69
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started