It is Question: Creating a program for a market. The system can send a family card to a consumer and accept a discount of 0% (no discount), 5%, or 10% based on the following rules: The default discount choice is "no discount." There is no discount for unregistered users. A family card is not supplied to an unregistered user. If a registered user has spent more than $1000 on past food purchases and has less than 19 shopping sessions, they will receive a 5% discount. If a registered user spent more than $1000 in prior grocery shopping sessions and had at least 20 grocery shopping sessions, they would receive a 10% discount. Only registered users who spend over $1000 or have at least 20 shopping sessions receive a family card. My program works just fine. It meets the conditions in the question. But my problem is I can't run Junit tests no matter how hard I try. According to my program, can you write Junit test and post the Junit test codes?
It is Question: Creating a program for a market. The system can send a family card to a consumer and accept a discount of 0% (no discount), 5%, or 10% based on the following rules:
- The default discount choice is "no discount."
- There is no discount for unregistered users. A family card is not supplied to an unregistered user.
If a registered user has spent more than $1000 on past food purchases and has less than 19 shopping sessions, they will receive a 5% discount.
-
If a registered user spent more than $1000 in prior grocery shopping sessions and had at least 20 grocery shopping sessions, they would receive a 10% discount.
-
Only registered users who spend over $1000 or have at least 20 shopping sessions receive a family card.
My program works just fine. It meets the conditions in the question. But my problem is I can't run Junit tests no matter how hard I try. According to my program, can you write Junit test and post the Junit test codes?
Step by step
Solved in 3 steps with 5 images