Question: Task - 2 : [ 5 0 pts . ] Write a java program to implement the following OrderingSystem class as shown in figure (

Task-2:
[50 pts.]
Write a java program to implement the following OrderingSystem class as shown in figure (a):
Figure (a)
Order
productName: String
quantity: int
set (productName, quantity): void
setProductName (productName): void
setQuantity (quantity): void
getProductName(): String
getQuantity(): int
readInput(): void
toString(): String
Figure (b)
This class has one private variable totalQuantityordered of type double and the array of objects of Order class. This class also have three methods. 1) computeTotalQuantity ()- this method computes the total quantity ordered for this order. 2) getData - this method first asks the user about how many products user want to order. Then, it creates the array of Order accordingly and calls the readInput () method of Order class to get data from user. 3) writeData ()- this method prints out the total quantity ordered and calls the tostring method of Order class to print the details of each product ordered.
The orderingsystem class uses the order class to store the information of product and quantity. Create the Order class separately as shown in figure (b):
The Order class has two private variables, productName and quantity. This class has reasonably defined constructors (no-arguments and arguments), the no-argument constructor must call the constructor that accepts arguments (with reasonable arguments) and the arguments constructor calls the set () method that sets the values for productName and quantity. This
COP2210-Assignment 7
Page 2 of 3
 Task-2: [50 pts.] Write a java program to implement the following

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!