. The class has the following five fields:
Customer name
Customer number
Quantity ordered
Unit price
Total price
Include set and get methods for each field except the total price field.
|
You're going to want five data members within the class: name(string), number(int), quantity(int), price(int/double?), total(int/double?). You're going to want them to be private members because the assignment calls for them to have get/set functions which will modify and call the variables themselves, so you'll never need public access to them.
Speaking of functions, you'll need ten.
Include set and get methods for each field except the total price field. The set methods prompt the user for values for each field. This class also needs a method to compute the total price (quantity times unit price) and a method to display the field values.
|
setName, getName. setNumber, getNumber, setQuanity, getQuanity, setPrice, getPrice, calculateTotalPrice, printOrder. Remember that the get function do not need parameters. They are just going to return a value from the class. All of these functions will be public.
This should get you started for now. :P I'd recommend getting the skeleton of your class set up first before you begin writing any functions. Just declare variables and write prototypes.