+1 (229) 255-3712
glass
pen
clip
papers
heaphones

  

You and your friends just won the lottery (congratulations!) Now you need to figure out how much money everyone is entitled to.

To do this you will be writing a short program that prompts the user for the amount they won, the number of people who are splitting the winnings, and the tax rate that will be applied to each person's share. Your program should then figure out how much each person will earn after taxes are applied to each share.

INPUT: Your program accepts the total amount won, the number of people who are splitting the winnings, and the tax rate (as an integer – i.e. 35 = 35%). Ensure that you store your data using variables of the appropriate data type.

OUTPUT: Compute the total amount won, the amount of each share, the tax due on each share and the final take-home amount for each person. Ensure that each of these values is formatted to two decimal places, and that the "comma" separator is included in your currency values, if necessary.

Sample input/output (user input is underlined):

How much money did you win? 1000000
How many people are splitting the winnings? 4
What is the tax rate on lottery winnings (i.e. 25 = 25%): 25

In total you won $1,000,000.00
Split 4 ways that amounts to $250,000.00 per person
Tax per person: $62,500.00
Take home amount per person: $187,500.00
How much money did you win? 5000000
How many people are splitting the winnings? 5
What is the tax rate on lottery winnings (i.e. 25 = 25%): 10

In total you won $5,000,000.00
Split 5 ways that amounts to $1,000,000.00 per person
Tax per person: $100,000.00
Take home amount per person: $900,000.00

Comment your source code and describe your code to someone who may be viewing it for the first time. Also include your name, the date, your class section and the name of your program at the top of your file. Run your program using the sample values above to ensure that your program generates the same output.