So We will create a java program but i don't know how to start it. We should use OOP in this one. And there should be minimum of 3 classes (including the main)..

Buy n’ Sell

An electronics and appliance store would like to install a kiosk for customer use. The kiosk allows the customer to take a look at available products for purchase or to sell his or her used but not defective gadget or appliance. You are asked to write a program for the said kiosk.

The program should do the following:
1.) Prompts the user if he or she wishes to buy or sell a product
2.) If the customer wants to buy, display available products for purchase
3.) Before user picks a product for purchase, prompts the user first for amount of cash in hand.
4.) After transaction, displays the products bought, cash paid, and change.
5.) If the user wants to sell a product, prompts user what type of product to sell.
6.) Prompts user for amount of the product to sell.
7.) After transaction, displays the product sold, amount of product, and payment from the transaction

There is the problem. I hope you can help me on HOW TO START my program.. Any ideas please?

Start by modeling an actual (real world) transaction with classes.

First class would probably be KioskGUI (The visual interface)

Another class would probably be CustomerOrder (the class used to manage customer order data processing, called on by KioskGUI or another class)

Products would be another class that makes sense (called on by the CustomerOrder class).

I would use more than three.

The possibilities are endless, but there is usually a practical model to follow. Everything, almost, can be turned into a class. Things that are directly related in functionality should be grouped into a class though.

Car analogy, if there is a Motor class it would depend on other independent classes, such as Alternator, etc...

This article has been dead for over six months. Start a new discussion instead.