Class mail order

Assignment Help C/C++ Programming
Reference no: EM13760249

I. Write the class MailOrder to provide the following functions:

Set up one one-dimensional array for each field: product number (integer), unit price (double), and current inventory level (integer) in main memory to hold the above product information. There should be five rows (0 to 4) in each array, one for each item. For example, row 0 of the array for the product number is to hold the product number of product 1. Row 0 of the array for the unit price is to hold the unit price of product 1. Row 0 of the array for the current inventory level is to hold the current inventory level of product 1, etc.

The system should accept incoming sales orders until the user chooses to quit. In each sales order, a user can buy more than one item. For each item, the system accepts the product number and the quantity to be purchased. The system retrieves the correct unit price and current inventory level for that particular item. The system only sells up to the current inventory available. If the system can sell x pieces of this item in this order, the system calculates and displays the total amount for this item and also decreases the item inventory level by x immediately. When the user has finished keying in all the items of an order, the system displays the order total amount.

When the user says there are no more orders, the system displays the daily sales total. This is the total sales amount of all the orders processed. Then the system should end the execution of the system.

Detailed description of how the system should work is as follows:

When the system is run:

Display the following main question:

Please enter the next action ( a new order and ): <user enters 1 or 2>

If the user enters any value other than 1 and 2, then the system displays an error message and displays the above question until the user has entered either 1 or 2.

If the user chooses entering a new order (1), then display the next product number question:
Please enter the next product number to buy (1 - 5 or -99 = end): <user enters 1, 2, 3, 4, 5 or -99>

If the user enters a value that is not one of -99, 1, 2, 3, 4, and 5, then repeat this question again until the user has entered one of the acceptable values.

If user enters -99, this means the end of the current order:

Display order summary, for example:

Order Total Amount: $ 72.83

Add this order total amount to the daily sales total amount.

The system should go back to asking the main question, as shown above.

If the user enters 1, 2, 3, 4, or 5 (these are product numbers), this is the next item to be purchased:

If the current inventory level of this product is 0, display "This item is out of stock. Please pick another one." The system goes back to asking for the next product number, as shown above.

If the current inventory level is > 0, display "Unit Price: <the unit price of this item> " and "Current Quantity Available: <the current inventory level of this item>"
ask for the quantity ordered, "Enter quantity ordered: " <user enters the quantity ordered>.

If the quantity available is smaller than the quantity ordered, sell only the quantity available. Otherwise, sell the ordered quantity.

Display "Quantity Sold: <the quantity that can be sold>"
Calculate the amount for this item as Unit Price * Quantity Sold.
Display the amount for this item: "Item Amount: $ <the amount calculated>"
Add this amount to the current order total amount.

Since this item has been sold, update the current inventory level of this item.

Repeat the above until the user enters -99 for the next product number to buy.

Then the system displays the main question again and repeats the above until the user enters a 2.

If the user chooses ending the whole order entry operation (2), then the system displays the daily sales total amount and ends the execution.

II. Write the class MailOrderTesting to provide the following functions:

In method main of this application, instantiate an object of MailOrder and call the method processOrders of this MailOrder object to start order processing.

Reference no: EM13760249

Questions Cloud

What impact to various stakeholders of acquiring a robot : Who are the stakeholders in this scenario (both internal and external)? What is the impact to the various stakeholders of acquiring a surgical robot unit?
Stories of transformative leadership : How do the staff members perceive the work they do? How is this perception affecting their relationship with each other and how might it be harmful to clients? Provide examples.
Describe the key characteristics of a whistleblower : Describe the key characteristics of a whistleblower, and briefly summarize one (1) researched instance of whistleblowing in one (1) publicly traded company within the last 12 months. Include the details of the issue that the whistleblower reporte..
What exactly means the idea of "tropicalization" of american : What exactly means the idea of "tropicalization" of American poetry developed by Nuyorican poets such as Victor Hernandez Cruz?
Class mail order : Set up one one-dimensional array for each field: product number (integer), unit price (double), and current inventory level (integer) in main memory to hold the above product information. There should be five rows (0 to 4) in each array, one for e..
Coral dawn link the features of its services to the needs : Coral Dawn, a chain of luxury spas, specializes in Thai massages, Ayurveda remedies, and acupressure treatments. Its target customers are those who enjoy weekend spa treatments after a stressful week at work. When advertising, which of the following ..
The history of children literature in western culture : Need a timeline prepared to illustrates the history of children literature in western culture using at least five key milestone.
Four components of gdp : In 400-800 words, list the four components of GDP and provide an example of each, explaining how each item affects you and the way that you live today.
An opportunity to really challenge : Write a rave about something you despise. here's an opportunity to really challenge yourself. Think of something you have experienced recently that you absolutely loathed. You should choose something that other people would be able to experience for ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd