Question: JAVA PLZZZ Q2) A customer is loyal if he consumes 1000$ or more in our shop. A loyal customer deserves a cash back (Bonus) on
JAVA PLZZZ
Q2) A customer is loyal if he consumes 1000$ or more in our shop. A loyal customer deserves a cash back (Bonus) on the amount that he spent as follows: Cash back 0% Amount spent O S to 999 $ 1000 $ to 1999 $ 2000 $ and more 10% 15% Write a method called getCashBack that takes as parameter the amount spent and returns the cash back amount. Write a test program (main) that reads the customer name and the amount spent by the customer and prints out if the customer is loyal or not (using the method getCashBack). Sample run 1: Enter customer name and amount spent: Fadi 2800 Fadi is a loyal customer, he spent 2800.0 $ and he will get 420.0 $ cashback Sample run 2: Enter customer name and amount spent: Samer 850 Samer is not a loyal customer, he spent only 850.0 $
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
