logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Write a menu-driven program named “ManageOrders” that provides the following options:

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Objectives:

Solve problem, design solution and implement using C++

Learn how to use basic C++ constructs and manipulate C++ string class

Handle different types of input errors

Description:

Write a menu-driven program named “ManageOrders” that provides the following options:

1. Purchase

2. Show purchase summary

3. Show all purchases

4. Exit

Basically, the program allows the user to make a purchase order (purchase description, unit price and quantity). It keeps track of all purchase info: number of purchases, total quantity, total purchase amount, the highest purchase order amount and and the list of all purchases.

A purchase order simply consists of its unit price (double), quantity (integer) and description (string). The description can be of multiple words such as “A C++ book”

Requirements:

1. The program must produce the same expected output as provided.

2. There is no need to use array or vector, just simply use string object and string concatenation to keep track of the list of all purchases

3. There should be no global variables. Please use only local variables and parameters instead

4. You must define and use at least 6 functions in your program

5. You are not allowed to use struct, array or vector to keep track of purchases. Please use only string and string concatenation for the list of purchases and use local variables and pass-by-reference parameters to keep track of the number of purchases, total quantity, total amount and highest amount purchase.

6. Scanf and printf are not allowed (Please use C++ cin and cout and C++ formatting)

7. Please format prices with only 2 decimal places after the period.

8. A sample of an expected output of a purchase:

DESCRIPTION(Student notebooks) UNIT-PRICE($1.23) QUANTITY(10) TOTAL($12.34)

Required error handling:

The program MUST perform the following checks and handle them gracefully:

1. Check for negative price such as -1 or -2

2. Check for price with letters in them such as 1.234ABC

3. Check for description to be empty or all blanks

4. Check for invalid menu option such as 0, 5, 50, 1A, 5B, ABC, 1ABC, or ABC1.

5. Display “There is no purchase in the list.” message when there is no purchase

Please see provided sample output and test data to test your programs.

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

998 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

825 Answers

Hire Me
expert
Husnain SaeedComputer science

879 Answers

Hire Me
expert
Atharva PatilComputer science

959 Answers

Hire Me