Write a java program which will simulate a "shopping card". Here is a sample interaction of the program:
>Welcome! Enjoy shopping! We sell a Shirt at $15, a pair of Shoes at $30 and a Hat at $5.
>What do you want to buy (enter "done" to quit)?
>shirt
>You are carrying 1 Shirt.
>What do you want to buy (enter "done" to quit)?
>Shoe
>You are carrying 1 shirt and 1 pair of shoes.
>What do you want to buy (enter "done" to quit)?
>Shirt
>You are carrying 2 shirt and 1 pair of shoes.
>What do you want to buy (enter "done" to quit)?
>Hat
>You are carrying 2 shirt, 1 pair of shoes, 1 Hat.
>done
>Your total bill is $65
>Goodbye
Your program should take the following inputs:
- If you want to buy a shirt, give input as: Shirt
- If you want to buy a pair of shoes, give input as: shoe
- If you want to buy a hat, give input as: hat
- If you want to quit the program: done
When you are done, submit your program in the dropbox.
No comments:
Post a Comment