Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
int main()
{
// variables
double jack_amount;
int choice;
double before_tax, after_tax;
cout<<"Please enter the jackpot amount:";
// read the amount
cin>>jack_amount;
cout<<"enter Payment choice (1 for cash, 2 for installments): ";
// read the choice
cin>>choice;
// if choice is cash then find the instant amount before and after tax
if(choice==1)
{
before_tax=jack_amount*.65;
after_tax=(jack_amount*.70)*.65;
cout<<"instantly received amount before tax : "<<before_tax<<endl;
cout<<"instantly received amount after tax : "<<after_tax<<endl;
}
// if choice is installments then find the each installment before and after tax
else if(choice==2)
{
before_tax=jack_amount/20;
after_tax=(jack_amount*.70)/20;
cout<<"installment amount before tax : "<<before_tax<<endl;
cout<<"installment amount after tax : "<<after_tax<<endl;
}
return 0;
}
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:120
enter Payment choice (1 for cash, 2 for installments): 1
instantly received amount before tax : 78
instantly received amount after tax : 54.6