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

file:///C:/Users/sanazir/Documents/Visual Studio 2013/Projects/WrightNathani... 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 # 1 Product Name Price I$19.99 I $59.99 I $20.50 I $105.99 I $16.99 Product 201 I ACME Anvil Product 558 I ACHE Du-speed Tonie 1$20.59 Product 558 I ACME Hi-Speed Tonic Product 909 I ACME Crash Helmet Product 910 I ACME Magnet

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

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions

Question

2. Identify examples of qualitative research.

Answered: 1 week ago

Question

Describe three other types of visual aids.

Answered: 1 week ago