1. Prompt for sibling’s name. Determine which sibling is the first, second, and third sibling.
2. Assign current savings for each sibling and display all of them.
3. By using loop, prompt each sibling on how much they usually spend every month and based on their answer, display the message:
Pocket Money Spent
Message
< 0
Negative! Are you serious?
You didn’t spend any money. Are you lying?
> 0 and < 100
Below average. What a good person!
≥ 100 and < 200
Average.
≥ 200
Above average. Consider to spend less!
4. By using loop, prompt for youngest sibling’s pocket money given by their parents. Pocket money will increase by RM10 from the youngest to oldest siblings.
5. Calculate total money for each sibling.
6. The sibling with the most amount of money will pay for dinner with a message “(Sibling), its your turn to pay for dinner!”
7. Display error message “Wrong input” if you key in negative number.
Comments
Leave a comment