Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

i need help on my shopping cart assignment

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i realy need help on my assignment... can i have some your ideas on how to do this one...i've been studying java for just two week and this is the first my first assignment.

Display a list of products available for purchase.
• The list of products is stored in a text file which is accessed by the system.
• System should show the product name, number of products available, and the price of the product.
• The products list should be numbered starting from 1 to allow customers to select the product they want to purchase.
• Should there be no products available for purchase, inform the customer and exit the application.


Display a list of products that are currently inside the shopping cart.
• The shopping cart is stored in a text file which is accessed by the system.
• The list displayed should be of the same format as that displayed by list of products.
• A grand total should be displayed at the end of the list, showing the amount the customer must pay for all the products bought.
• Should the shopping cart be empty, inform the customer that the shopping cart is empty.


Allow user to buy a product.
• Accept a product number and quantity.
• Validate user input.
• Do not allow customer to buy products that do not exist.
• Do not allow customer to buy more products than that being sold.
• Do not allow customer to buy products with negative quantity.
 
Bartender
Posts: 612
7
Mac OS X Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well how you do this is that you take a paper and pencil and write down how you would do this……

Then you rewrite it, and rewrite it until you can hand it to a 10yr old and they could do it.


then and only then, you figure out the smallest part of that you can write and verify it correct - then implement that.

then find the next smallest thing you can implement and verity correctness - then implement that

redo above line until project is done. :-)

 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!