Question: this lab you will work with objects. You can download all files via the provided link or from canvas - Download the Order class documentation.

 this lab you will work with objects. You can download allfiles via the provided link or from canvas - Download the Orderclass documentation. - Study the class (Order.java) and familiarize yourself with alldetails of this class. - Study the list1.txt, list2.txt. - Create anew class called Lab10. - Inside this class, you want to askthe user for a filename, read from the text file line byline, create a new Order object with the data you read fromeach line, print each Order object, calculate the price of each Order,and add up all prices and print the result as shown below.

this lab you will work with objects. You can download all files via the provided link or from canvas - Download the Order class documentation. - Study the class (Order.java) and familiarize yourself with all details of this class. - Study the list1.txt, list2.txt. - Create a new class called Lab10. - Inside this class, you want to ask the user for a filename, read from the text file line by line, create a new Order object with the data you read from each line, print each Order object, calculate the price of each Order, and add up all prices and print the result as shown below. - You want to use the Order api to generate the following output. - You can download the list1.txt, list2.txt and files here, or from canvas. - You can assume all the data inside the file are always correct, so you don't need to do any expectation handling for reading things from a text file. - Format your output for printing the total sum to look exactly like the sample run. Rules that must be followed: - All methods must be less than or equal to 10 lines. Empty lines, method headers, and lines with only comments and curly braces are not counted. - You can have as many methods as you like. public class Order extends java. lang.0bject Meisam Amjad Lab11 Order Class used for creating Order Objects. Copyright(c) APR 2021 Constructor Summary Constructor and Description Order(int newBarcode, java. lang.String newNane, int unitNums, doul The Order constructor. Method Summary Methods inherited from class java.lang.Object clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait Constructor Detail Order public Order(int newBarcode, java. lang.String newName, int unitNums, double unitPrice) The Order constructor. creates a new Order object with the given info. Parameters: newBarcode - int a barcode newame - String a name for this order unitNums - int the number of units for this order unitPrice - double the price of each unit setName public void setName(java. lang.String newame) Changes the name to the given newName. Paramoters: newame - String The new name. getUnits public int getUnits() Returns the number of units. Returns: int The number of units. setUnits public void setUnits(int unitNuns) Changes the unitNums to the given unitNums. Parameters: unitNums - int The new value for units. getPriceUnit public double getPriceUnit() Returns the value of priceUnit. Returns: double The value of priceUnit setPriceUnit public void setPricellit (double unitPrice) Changes a priceUnit to the given unitPrice. Parameters: unitPrice - double The new value for priceUnit. equals public boolean equals(java. lang.0bject object) Compares two Order objects based on the barcodes. If they have the same barcode it returns true, and false otherwise. Overrides: equals in class java. lang. Object \begin{tabular}{ll|l} 123 Chicken 110.0 & 12342 Pen 10.25 \\ 345 Wine 213.20 & 12343 Book 101.35 \\ 480 Pepsi 120.75 & 12353 Mouse 112.0 \\ 511 rice 17.15 & 12359 Keyboard 143.99 \\ 178 Oreo 32.99 & 12313 Chips 2.89 \\ 186 Coffee 29.85 & 12314 Icecreame 51.30 \\ 102 Icecreame 51.30 & \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!