Im having problems writing code for this program I have due Monday. Any and all help would be greatly appreciated!! Here's my problem.
Order class, contains an order number, customer name, and address(assume its just a street address), a list of item numbers ordered(up to four) this part is an array, the total price of all items ordered and shipping and handling fee for the order. Include a constructor to set the field values and get methods to retrieve the field values.
This is what I have come up with so far im just not sure if its all correct.
Code:public class Order { private int orderNum; private String name; private String address; private int itemNums; private double totPrice; private double sah; Order() { int orderNum = 0; String name = ""; String address = ""; int[] itemNums = new int[4]; double totPrice = 0.0; double sah = 0.0; } public int getOrderNum() { return orderNum; } public String getName() { return name; } public String getAddress() { return address; } public int getItemNums() { return itemNums; } public double getTotPrice() { return totPrice; } public double getSah() { return sah; } }


Reply With Quote


Bookmarks