• Post Reply Bookmark Topic Watch Topic
  • New Topic

A simple class: Retail Item and Retail Client  RSS feed

 
Anthony Ross
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello I'm in need of assistance or guidance, I need help on how to complete the processSale() method. This is a two part assignment which I already completed the retail item but I'm in need of of help with the retail client. Thanks.
 
Ben Allen
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, what's the question?
 
Anthony Ross
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben Allen wrote:Sorry, what's the question?


Just need guidance in completing the processSale method at the bottom.

Basically:

//Process the sale of a single RetailItem
// If there are available units of the requested item,
// the stock is depleted by 1
// If there are no units of the requested item available
// the item is re-stocked by adding 5 additional units
//A trace of the transaction is displayed in the console:
// SALE Jacket
// Your Price $59.95 Thank You!
// OR
// SALE Jacket
// Sorry, Temporarily OUT OF STOCK
//
private static void processSale(RetailItem item)
{
String trace = "";
System.out.println(trace);
}


If you could please explain to me this in simpler terms how to go about this. Thanks.
 
Ben Allen
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried breaking the problem into the simplest steps you can? That always helps me. Try to understand the problem as a series of fully described steps, then go about solving them.
 
Anthony Ross
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, but i just can't seem to get this one, should I be throwing a boolean expression to process the sale?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!