Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 z. For this you will use null as the sentinel), as shown in screenshot below

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

  1. 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.
  2. The project will be called ACMEStore.

image text in transcribed

image text in transcribed\

image text in transcribed

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 z to exit: Product # Product Name ------------ --------------- Product 201 | ACME Anvil Product 556 | ACME Dynamite Product 558 | ACME Hi-Speed Tonic Product 909 | ACME Crash Helmet Product 910 | ACME Magnet | Price -- -------- | $19.99 | $59.99 $20.50 | $105.99 | $16.99 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Product Code: 201 Quantity: 2 Product Code: 556 Quantity: 3 Product Code: 910 Quantity: 2 Product Code: 201 Quantity: 5 Product Code: *Z Customer Name: Salman Nazir Items Ordered: Price Qty Line Total ----- -------------- * 2 Product # Product Name --------------------------------- Product 201 - ACME Anvil Product 556 - ACME Dynamite Product 910 - ACME Magnet Product 201 - ACME Anvil * 3 @ $19.99 @ $59.99 @ $16.99 @ $19.99 - $39.98 = $179.97 $33.98 $99.95 * * 2 5 - - - - - - - - - Invoice Total: $353.88

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxiv Special Issue On Database And Expert Systems Applications Lncs 9510

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Hendrik Decker ,Lenka Lhotska ,Sebastian Link

1st Edition

366249213X, 978-3662492130

More Books

Students also viewed these Databases questions

Question

Distinguish between hearing and listening.

Answered: 1 week ago

Question

Use your voice effectively.

Answered: 1 week ago