Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

Students also viewed these Programming questions