Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Definition This assignment requires the development of C++ software that supports order processing, account management, and inventory control activities of an imaginary food service.

Assignment Definition

This assignment requires the development of C++ software that supports order processing, account management, and inventory control activities of an imaginary food service. Assume that customers of this food service will use a separate Web-based app (not included in this assignment) to browse product catalogs and then create shopping lists stored in specially formatted text files (see input definitions below). Each shopping list may include:

Food item names and quantity.

Coupon information that includes the name of the food and discount amount.

To process these shopping lists, customers must first create an account with your service. Each account is identified by a unique customer id and maintains an amount of money that may only be used for food purchases (i.e., a debit account). Customers enter a dollar amount when the account is created. Once they have an account, then they may select one of the following actions provided by your service program.

Retrieve a shopping list file and save it to a virtual cart (only one virtual cart per customer).

Retrieve a saved cart.

Add or remove items from a saved shopping cart

Create shopping cart reports (output text file with list of saved cart items for a specific customer).

Process the current cart (checkout). Saved carts must be deleted after checkout.

Also, customers must be able to perform the following basic functions on their account.

Add money to their food service account.

Display account information.

The inventory for this food service must be controlled by a food service manager. Your application must provide the following functions for the service manager.

Addition of food item quantity to the inventory of the food service (i.e., re-stocking).

Prices changes for food items. (Note: Official prices are stored in the inventory not shopping carts).

Creation of inventory control reports (for the entire inventory or selected items).

Therefore, the main function of your application, must prompt the user for the following actions using a simple console window.

Login or create an account. (Service manager account must already be in your system.)

If service manager,

Add quantity to inventory.

Update inventory prices.

Display inventory report.

If customer,

Display account information.

Add money to account.

Retrieve a shopping list file.

Retrieve a saved cart.

Update cart contents.

Display cart report.

Process the cart (checkout)

Assumptions, Pre-conditions and Minimum Data Requirements

General:

Customer account info (name, account#, etc.) must be saved on disk.

Shopping lists must be stored in separate pre-created text files. (See below.)

A simple console user interface must be provided for all user functions.

There are two types of users customers and service managers. They must both login.

Payment and

Debit Accounts:

Customers set an initial balance on their service debit account when it is created.

You must reject payments over the amount available in a customer account.

Customers may add money to their accounts at any time.

If the total cost of cart items exceeds account balance, then cancel checkout.

Food Items:

You must define a minimum of twenty (20) types of food items.

Initial inventory (food, quantity, prices) must be pre-loaded into an inventory file.

Every request to add or remove a food item must include a quantity.

Price changes to inventory do not affect price of items in carts.

Adding or removing food to carts causes only temporary changes to inventory data.

Shopping Carts:

Each customer may use only one cart at a time.

The food service can handle a maximum of twenty (20) customers at one time.

Customers may save cart contents on disk and retrieve them later.

Carts will contain no duplicate items.

Customer cart reports must show all cart items with prices, quantities, and a total.

Each cart is deleted immediately after payment and checkout.

Each remove request may only remove one cart item at a time.

Entire quantity for each food item in a cart must be available (no partial orders).

Inventory

Control and

Reporting:

The store manager may perform re-stocking actions at any time.

Food re-stocking inputs specify food item names, prices, and quantities.

Re-stocking quantity values must be added to current quantity levels.

Inventory control reports are only displayed on a console screen not saved to a file.

Implementation Requirements

You must use the following features or structures of the C++ programming language.

At least one (1) instance of inheritance using your own classes.

At least one (1) use of polymorphism and at least one (1) use of composition.

Initialization of class data must be performed in class constructors.

The array class template.

Pointer data types and the C++ String class.

At least one (1) instance of operator overloading other than stream input or output.

At least one (1) use of an STL container with associated iterator and algorithms.

Exception handling must be implemented to validate user inputs.

All customer account, cart and inventory data must be stored in random access binary files (.dat).

Shopping list files must be input as sequential stream text.

Input Definitions

Customer shopping lists

Customer shopping lists must be created with a text editor and stored in text files. The name of each list file must include the customer account number and a simple sequence number (e.g., C12765_L01). You must pre-generate enough sample shopping list files to adequately test your application and all of its functions. Here is a couple examples.

C271655_L01.TXT C271655_L02.TXT

Notes:

Each coupon description is enclosed in square brackets and values separated with a comma.

Customer account number is a 6-digit value (e.g., 237384)

Customer Shopping Carts

Your project code must create shopping carts from customer selected shopping lists. (One list saved as one cart.) After the cart content is saved on disk, your code must allow the customer to add or remove food items or coupon items. Here is a few examples of cart update requests.

ADD,Milk,1

REMOVE,Tea,1

ADD,Coupon[Chicken,-0.50]

REMOVE,Coupon[Cheese]

Data Resource Files

You must design your own files to hold data that your application needs to run properly. However, you must use only one file for all customer account data, one file for all cart data and one file for all inventory data. Each of these three data files must use random access with binary format.

User Output Definitions

Shopping Cart Reports

Customers may request to see the contents of their shopping cart at any time. Upon request, you must display the following information to the console window.

Customer account number

A list of food items with associated quantity and price values

Total cost of all items in this cart

Checkout Receipt

This is a report is almost identical to the cart report but it also includes a record of coupons applied.

Customer account number

A list of food items with associated quantity and price values

A list of coupons each represented by the associated food name and discount price

Total cost of all items in this cart at checkout

Inventory Reports

There are only two types of inventory reports one that shows all food items and one that shows only a selected item.

Service manager id

A list of food items with associated quantity and price values

OR

Service manager id

One food item with associated quantity and price value

Validation and Error Messages

You must use C++ exception handling (try-throw-catch) to check for the follow exceptions. Print an appropriate error message in the console window whenever these exceptions are detected.

Food request quantity not available in inventory

Insufficient quantity or missing item in cart for remove request

Insufficient funds in debit account at checkout

Required Items to be Submitted

Part 1: UML class and communication (collaboration) diagrams.

Communication diagrams must show the sequence of method calls for each of the 3 service manager functions and each of the 7 customer functions (not including account login or creation). You may create a separate diagram for each user function or combine them as long as they are readable.

Part 2: Diagrams of customer, cart, and inventory files showing multiple rows of sample data values.

Part 3: Final tested version of C++ code (submit only cpp and h files).

Sample UML Class Diagram (partial example)

+ represents a PUBLIC item and - represents a PRIVATE item.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions