Question: IN C# - Problem #1: Hit the jackpot! Congratulations you have won the lottery! We will now calculate how much your actual total winnings will
IN C# - Problem #1: Hit the jackpot! Congratulations you have won the lottery! We will now calculate how much your actual total winnings will be. You have two options; the first option is a lump sum one-time payment. If you do this you will only receive 85% of your winnings. The second option is to take 20 annual payments but you take the full amount. First you will want to prompt the user for their total amount of winnings, validate this and convert this to the correct data type for money and store it in a variable. Then you will ask the user if they want it all at once with the % taken out or if they want the annual option. Give them the choice of an (L) for Lump Sum or (A) for Annual. Upper or lowercase letters should work. (HINT look up .ToLower() or .ToUpper() ) Validate that this text string is one of the 2 choices. (HINT use the != validation technique.)
User Input: o Dollar amount of winnings o Payment type (A String holding an L for lump sum or a A for annual)
Result: o If Lump Sum is chosen:
Yourwinningsof$Xasaone-timelumpsomepaymentis$Y.o If Annual is chosen:
Yourwinningsof$Xwillbepaidin20paymentsof$Yayear. Data Sets to Test:
(Note that data sets are not the only numbers that should work with your code, but you need to be sure to test these plus 1 of your own for the test value section.)
o Winnings = 20000, Payment Option= A Results=Yourwinningsof$20,000willbepaidin20paymentsof$1,000
a year. o Winnings = 100000.50, Payment Option= L
Results=Yourwinningsof$100,000.50asaone-timelumpsome payment is $85,000.425.
o Winnings = 65000000.99, Payment Option= a Note the lowercase letter! Results=Yourwinningsof$65,000,000.99willbepaidin20payments
of $3,250,000.0495 a year.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
