The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Java Programming:
Â
We will have an online store with media items, and customers that can buy, own, and use these items.
The store will have various types of media -- books, movies, and programs. Each of these has a name, a price, and a size (how many MB of storage space it takes up) and books, movies, etc, should have other appropriate information specific to them. Users can "use" their media items; when a book is used, it is read and we should tell the user the title and how many pages, when a movie is used, the video plays, and we should tell the user how many minutes long it is, when programs are used they run, and we should tell the user the version. (You only need to display messages to say that these things are happening; you do not need to worry about any actual media.).
The store has a list of media items being sold (at least 20, including some from each type). This list can be shown to the user. Items from the list can be chosen (by their number in the list) to buy (note that when a customer buys from the store, that doesn't remove the store's copy). Â
The store also should have a list of at least three customers. Â
Each customer has a name, a balance (how much money is in their account), a certain amount of total storage space (e.g. 1GB), and a list of the media they have bought (you can assume they never buy more than 100 items). Â
Customers can browse their own media, in which case they are shown all the items they own, and can choose from the list an item to use. Â
Customers can shop the store and buy a new item, in which case we need to check that there is enough storage space left, and they have enough money, and if so, buy the item and add it to the list (and remove that much money). (Note that the amount of space left is their total storage space minus the total storage space of all the media they currently own).Â
(Extra Credit + 10) If they don't have enough storage space, ask if they want to buy more, at $25 per 1GB (if they can afford it), and if so, let them increase their space and charge them accordingly.
At the beginning of the program, a customer can log in by typing in their name. (Put a comment at the top of your main class with the customer names, so that I can test your program without having to search!)
A customer who is logged in can add money to their balance, browse the media they already own, shop for more, or log out. Â
If they browse, they can choose to use any of their media.
If they log out, allow a new customer to log in. Within one run of the program, a customer should be able to log in, buy new media, log out, then log back in again later and see their new media when they browse.
-----------