1. Powerball. Generate 5, numbers between 0 and 55. Assure there are no duplicat
ID: 3539719 • Letter: 1
Question
1. Powerball. Generate 5, numbers between 0 and 55. Assure there are no duplicates. Have the user enter their guesses and based on the following scheme print out their winnings.
1 guess right - payout $10, 2 - payout $150, 3 - payout 2000, 4 - payout $13000, 5 - jackpot 1 millon dollars.
Allow the user to play again!
2.
Grocery store program. Create a loop that can be stopped by the user by entry inside the loop(for example "enter a zero to quit"or "enter a q to quit"). Inside the loop create a menu system (review Lesson 10 page 10-1) listing the items and their cost in your grocery store (must be real items for example apples - 10 cents per). You must have at least 10 items that have different prices.
Ask the user the quantity of the chosen item. Determine the cost and keep a running total to display after every entry. Once the user "fills their cart%u201D and quits the menu (loop ends) ask if they are a member of your A+ customer club, if yes deduct 20% from the total, otherwise no discount. Next add a 7.5% sales tax. Display the discount, tax, and result total.
Explanation / Answer
Code 2
Sample output
Welcome to shopmart
There are various products here. Happy shopping
Press q to exit the kart
sd
Do you want to buy apples? Rate : 10 cents per apple
Enter the quantity to buy or press 0 if you dont want to buy
10
Do you want to buy oranges? Rate : 11 cents per orange
Enter the quantity to buy or press 0 if you dont want to buy
0
Do you want to buy banana? Rate : 8 cents per banana
Enter the quantity to buy or press 0 if you dont want to buy
80
Do you want to buy umbrella? Rate : 2 dollar per umbrella
Enter the quantity to buy or press 0 if you dont want to buy
q
Are you the member of A+ customer club? Type Yes or No
yes
As you are our A+ member, we offer you 20% discount which is equivalent to $:1.48
Your price after discount is $: 5.92
Tax taken $: 0.444
After applying the tax total price to be paid is : 6.364
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.