121k views
4 votes
python programming 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. 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

2 votes

Answer:

#here is code in python

#read the jackpot amount

amount=float(input("please enter the jackpot amount:"))

#read choice of payment

user_choice=input("enter your choice of payment(1 for cash, 2 for installments):")

#if choice is cash

if user_choice=='1':

#instant amount before tax

b_tax=amount*.65;

#instant amount after tax

a_tax=(amount*.70)*.65;

print("instantly received amount before tax : ",b_tax)

print("instantly received amount after tax : ",a_tax)

#if choice is installment

elif user_choice=='2':

#installment amount before tax

b_tax=amount/20;

#installment amount after tax

a_tax=(amount*.70)/20;

print("installment amount before tax : ",b_tax)

print("installment amount before tax : ",a_tax)

Step-by-step explanation:

Read the jackpot amount from user.Next read the choice of Payment from user. If user's choice is cash then calculate 65% instantly amount received by user before and after the 30% tax.Print both the amount.Similarly if user's choice is installments then find 20 installments before and after 30% tax.Print the amount before and after the tax.

Output:

please enter the jackpot amount:2000

enter your choice of payment(1 for cash, 2 for installments):2

installment amount before tax : 100.0

installment amount before tax : 70.0

User Dew Time
by
5.5k points