Question: write me a C# code Consider the following UML diagram: Sales is a class that contains knowledge of purchase orders that a business has received.
write me a C# code Consider the following UML diagram:
Sales is a class that contains knowledge of purchase orders that a business has received. There
are two types of purchase orders: single transaction orders and batch orders, which the class
Sales records separately in two dedicated lists. Batch orders are instances of class Batch and
can be added to its corresponding list, batchorders, using method AddBatch. Single trans
action orders, on the other hand, are instances of class Transaction and can be added to its
corresponding list, singleorders, using method AddTransaction. All orders can be printed
to the console via method PrintOrders.
Class Batch defines three member variables:
number, a string that identifies this order,
name, a string that captures the purpose of this order, and
items, a list of single orders attached to the bulk order.
In addition, class Batch defines the methods
Add to add a single order,
Print to print this order, and
Total to return the total sum of this order.
Finally, class Batch defines two readonly getters to obtain the Number and Name of the order.
Class Transaction is similar. Its member variables are:
number, a string that identifies this order,
name, a string that describes the product in this order, and
amount, a decimal value to store the total of the single transaction.
Class Transaction defines a Print and a Total method, which print the order and return the
amount of this order, respectively. The readonly getters return the Number and Name of a
single transaction order.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
