Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java - Order

katlego
katlego 


Create a class named Order that performs order processing of a single item. 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. 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. Create a subclass named ShippedOrder that overrides computePrice() by adding a shipping and handling charge of $4.00. Write an application named UseOrder that instantiates an object of each of these classes. Prompt the user for data for the Order object, and display the results, then prompt the user for data for the ShippedOrder object, and display the results. Save the files as Order. java, ShippedOrder.java, and UseOrder.java Tags: useorder, shippedorder, computeprice, order, java Attachments Tags Clarifications

Answers

Java - Order - Solution

dickersonka
dickersonka 



Attached is the solution to the Java - Order assignment including source and comments Attachments
Order.zip (1 K) Download
Preview
@return the customer number */ public int getCustomerNum() { return customerNum; } /** * Set the customer number */ public void setCustomerNum(int customerNum) { this.customerNum = customerNum; } /** * Get the quantity of a unit * @return the quantity of the unit */ public int getQuantity() { return quantity;

Preview
* Display the updated info */ @Override public void displayInfo() { computeTotalPrice(); System.out.println("Customer Name : " + customerName + "\n" + "Customer Number : " + customerNum + "\n" + "Quantity Ordered : " + quantity + "\n" +

Preview
quantity: "); int quantity = input.nextInt(); //prompt for unit price System.out.print("Enter the unit price: "); double unitPrice = input.nextDouble(); input.nextLine(); //create order Order order = new Order(customerName, customerNum, quantity, unitPrice); //display order information System.out.println(); order.displayInfo(); System.out.println(); //prompt if item needs shipped System.out.print("Does the

UseOrder_output.png (10 K) Download Preview

Screenshots
Screenshot
Purchase Answer

Assignment Solution

mariobeka
mariobeka 



Below you will find the java files required. The code has comments throughout the classes to make things easier to understand. A screenshot is also included that shows the program working. Attachments
Screen Shot 2014-10-04 at 10.07.18 PM.png (105 K) Download Preview

UseOrder.java (1 K) Download Preview
System.out.print("Please enter the quantity: "); quantity = keyboard.nextInt(); System.out.print("Please enter the unit price: "); unitPrice = keyboard.nextDouble(); // Create a new instance of the Order Order order = new Order(customerName, customerNum, quantity, unitPrice); // Compute the Price order.computePrice(); // Display the Info order.displayInfo(); keyboard.nextLine(); // Ask the user if the

ShippedOrder.java (1 K) Download Preview
extraCharge = 4; private double totalPrice; /** * ShippedOrder Constructor * @param order the order that has been made */ public ShippedOrder(Order order) { super(order.customerName,order.customerNum,order.quantity,order.unitPrice); } /** * Compute the new price including the extra shipping charge

Order.java (2 K) Download Preview
* @return the customer number */ public int getCustomerNum() { return customerNum; } /** * Set the customer number */ public void setCustomerNum(int customerNum) { this.customerNum = customerNum; } /** * Get the quantity of a unit * @return the quantity of the unit */ public int getQuantity() { return

Screenshots
Screenshot
Purchase Answer

For DOWNPAYMENT Only - No Answer attached

SW_wizard
SW_wizard 



Please buy this for the downpayment. Attachments
Screenshots
Purchase Answer

All the 3 files are attached with complete solution

nouman92
nouman92 



all the three file contain complete solution of the assignment .buyer may request the modification according to their requirements.
Price is for complete solution
Attachments
Order.java (1 K) Download Preview
public int getUnitprice() { return unitprice; } public void setUnitprice() { System.out.println("Enter the Unit Price:"); this.unitprice = scan.nextInt(); } public int computePrice() { Totalprice= unitprice * quantityordered; return Totalprice; } public void Invoice() { System.out.println("Customer Name :

ShippedOrder.java (1 K) Download Preview
package crameshark; public class ShippedOrder extends Order { public ShippedOrder() { super(); } @Override public int computePrice() {

UseOrder.java (1 K) Download Preview
main(String []arg) { Order order1=new Order();

Screenshots
Purchase Answer

Solution : Java-Order. Best Quality and Work

best_solution
best_solution 



Hi,

Please find attached the asnwer for your Java-Order assignment. Its working perfectly fine with prompts to the user for options based on Java Swings.

Regards,
best_solution
Attachments
Order.java (1 K) Download Preview
= val; } public String getCustNumber() { return custNumber; } public void setCustNumber() { String val = JOptionPane.showInputDialog(null, "Enter the customer number"); this.custNumber = val; } public int getQtyOrdered() { return qtyOrdered; } public void setQtyOrdered() { int val = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter quantity ordered")); this.qtyOrdered =

ShippedOrder.java (1 K) Download Preview
public float calculateTotalPrice() { return HANDLING_CHARGES

UseOrder.java (1 K) Download Preview
compute total price of Order order.calculateTotalPrice(); // display values order.displayValues(); shippedOrder.setCustName(); shippedOrder.setCustNumber(); shippedOrder.setUnitPrice(); shippedOrder.setQtyOrdered();

Screenshots
Purchase Answer