24.4k views
2 votes
The jackpot of a lottery is paid in 20 annual installments. There is also a cash option, which pays the winner 65% of the jackpot instantly. In either case 30% of the winnings will be withheld for tax. Suppose the jackpot is $100. If installments are chosen, the winner will receive $5 each year before tax, and $3.5 each year after tax (because 30% of $5 is withheld for tax). If cash option is chosen, the winner will receive $65 instantly before tax, and $45.5 instantly after tax (because 30% of $65 is withheld for tax). Design a program to do the following. Ask the user to enter the jackpot amount. Calculate and display how much money the winner will receive annually before tax and after tax if annual installments is chosen. Also calculate and display how much money the winner will receive instantly before and after tax if cash option is chosen

1 Answer

3 votes

Answer:

Following are given instructions to design the required program:

  • Get the Jackpot amount from user.
  • Get the payment choice from user.
  • If user enters, the amount to be cash:

=> calculate 65% of amount received instantly.

=> Calculate 30% tax amount.

  • Print both amounts.
  • If user enters, installments:

=> Calculate 20 installments first.

=> Calculate 30% tax amount.

  • Print both amounts.

Source Code:

The source code of the program is displayed below in the image:

I hope it will help you!

The jackpot of a lottery is paid in 20 annual installments. There is also a cash option-example-1
User Thibauts
by
4.2k points