Question
Please write a c# program that meets the following Problem Description: The ACME Corporation would like you to develop an application that can be used
Please write a c# program that meets the following
Problem Description:
The ACME Corporation would like you to develop an application that can be used to handle its sales transactions. As the application begins, it prompts for customer name, which is then used to print a welcome message. The application then prints the various products that the store offers along with their respective prices, as shown in the following screenshot:
Next, the application asks for the product code and the quantity continuously until the user indicates that no more products are to be purchased (the user indicates this by the pressing
When the user indicates that no more products are to be added, the program prints the customer name, the subtotals and the invoice total as shown in the screen shot below:
Technical Specifications:
- You will submit two classes, Transaction and TransactionTest. TransactionTest will drive the class Transaction.
Class Transaction must have the following:
- Instance variables or auto-implement properties:
- A decimal variable, which will hold the transaction total.
- A string variable, which will keep track of the individual items that the customer purchases. This will be eventually displayed on the screen.
- An auto-implemented property to handle the customer name.
- A constructor that accepts customer name (a string) as a parameter. The constructor assigns this parameter to the customer name property.
methods
- A method which displays the welcome message along with the products and their prices (output of this method is shown in the first screenshot).
- A method which will ask for the product code and quantity to add to the transaction. Using appropriate control structure, this method will update the total according to price of the product purchased. This respective product price should be hard-coded in the control structure. The control structure will also build the transaction details by adding the product subtotal to the total. (the output of this method is shown in the second screenshot).
- A method which will print out the customer name, transaction details, and total of the customer purchases rounded to two decimal places (see third screenshot). Make sure that your output looks like the screenshots given above.
Class TransactionTest must drive the application by:
- Creating an object of the class Transaction using its constructor. The customer name will be prompted from the user and will be provided to the constructor.
- Calling the method that displays the product prices.
-
- Then calling the method that would ask the user for the products they would like to purchase.
- Finally calling the method that would show the final transaction details as shown in the screenshot above.
Submission Guidelines:
You will name the two classes as Transaction.cs and TransactionTest.cs
- The classes must contain your name and student number as well as the purpose of the program in the top section of each class as comments.
- The project will be called ACMEStore.
\
Please enter Customer Name: Salman Nazir Welcome, Salman Nazir, to ACME Corporation's Product Shop! Please choose from the following products by entering the product code followed by the quantity. Enter
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started