Assignment Definition This assignment requires the development of C software tha
ID: 666975 • Letter: A
Question
Assignment Definition This assignment requires the development of C software that supports the back-end activities of an imaginary food service (i.e., software that simulates the processing of customer service requests and management of inventory) Customers will use a separate Web-based app that stores request details in specially formatted text files (see input definitions below). Your food service application must read these text files, manage active order activity in virtua shopping carts and then update inventory and produce receipts (as output text files when orders are complete Also, your application must manage customer payment accounts and provide system support functions for inventory control and reporting. The following list represents the minimum set of functional requirements Addition of food items to shopping carts. (Inventory is temporarily updated Removal of food items from shopping carts. (Temporary changes to inventory are cancelled Creation of shopping cart reports. (Output text file with list of cart items for a specific customer Processing of payment upon checkout. (Includes processing of coupons.) Processing of order information in customer carts upon checkout. (Commit changes to inventory.) Management of debit accounts for customers. (All payments must be made from these accounts.) Addition of food item quantity to the inventory of the food service (i.e., re-stocking) Creation of inventory control reports. (Report for entire inventory or for specific food items.) Assumptions, Pre-conditions and Minimum Data Requirements must be pre-loaded in a customer file General Customer account info (name, account#, etc. Customer requests may be stored in s arate or combined text files. (See below Sample request files used for testing must be pre-generated e console user interface must be provided for invento control and r A sim orting Customers are given an initial balance on their service debit account Payment and Debit Accounts You need to keep track of account balances and reject payments over that amount Customers may submit requests to add money to their food service debit accounts If total cost of cart items exceeds account balance, then cancel checkout You must define a minimum of twenty (20) types of food items Food Items: Initial inventory (food, quantity, prices) must be pre-loaded into an inventory file Customers must specity a quantity for each food item request Price changes may occur during re-stocking but do not affect price of items in carts Adding or removing food to carts causes only temporary changes to inventory data Each customer may use on Shopping Carts one cart at a time The food service can handle a maximum of twenty (20) active carts at one time Customers may save cart contents and continue later but only on the same da Checkout request files w also contain any coupon information. (Max. 10 coupons. Customer cart reports must show all cart items with prices quantities, and a tot Each cart is deleted immediate after payment and checkout Customers may only remove cart items for one food item at a time specified for addition to a cart must be available (no partial orders Entire quan ort staff may perform re-stocking actions at any time Inventory Service su Control and Food re-stocking inputs specify food item names, prices, and quantities Re-stock in uantity values must be added to current guantit Reporting evels a console screen not saved to a file Inventory control reports are on displayed onExplanation / Answer
this question has lot of subparts. Please post 2-3 more questions for the same. I have created a initial implementation of the backend and how it should work.
#include <iostream>
#include <iomanip>
using namespace std;
// Function Prototypes
void showMenu();
void showFees(double, int);
int main()
{
int choice; //To Hold Menu Choice
int quantity;
//contants for menu choices
const int hamburgerChoice = 1;
const int hotdogChoice = 2;
const int peanutsChoice = 3;
const int popcornChoice = 4;
const int sodaChoice = 5;
const int chipsChoice = 6;
const int waterChoice = 7;
const int endOrderChoice = 8;
//constants for menu prices
const double hamburger = 6.00;
const double hotdog = 4.50;
const double peanuts = 3.75;
const double popcorn = 5.50;
const double soda = 2.80;
const double chips = 1.00;
const double water = 2.00;
//set precision
cout << setprecision(2);
do
{
//display menu and get user choice
showMenu();
cin >> choice;
cout<<"Please enter the quantity"<<endl;
cin >> quantity;
//validate choice
while (choice < hamburgerChoice || choice > endOrderChoice)
{
cout << "Please enter a valid menu choice: ";
cin >> choice;
}
//if the user does not want to quit proceed
if (choice != endOrderChoice)
{
//display fees
switch (choice)
{
case hamburgerChoice:
showFees(hamburger, quantity);
break;
case hotdogChoice:
showFees(hotdog, quantity);
break;
case peanutsChoice:
showFees(peanuts, quantity);
break;
case popcornChoice:
showFees(popcorn, quantity);
break;
case sodaChoice:
showFees(soda, quantity);
break;
case chipsChoice:
showFees(chips, quantity);
break;
case waterChoice:
showFees(water, quantity);
break;
}
}
}
while (choice != endOrderChoice);
return 0;
}
//*************************************************************
//Definition of function showMenu which displays the menu **
//*************************************************************
void showMenu()
{
cout << " Baseball Game Snacks" << endl;
cout << "1. Hamburger $6.00"<< endl;
cout << "2. Hotdog $4.50" << endl;
cout << "3. Peanuts $3.75" << endl;
cout << "4. Popcorn $5.50" << endl;
cout << "5. Soda $2.80" << endl;
cout << "6. Chips $1.00"<< endl;
cout << "7. Water $2.00" << endl;
cout << "8. END ORDER" << endl;
cout << "Please enter your menu choice: ";
}
void showFees(double itemCost, int quantity)
{
double amtTendered;
double totalBill = (itemCost * quantity);
double taxRate = .065;
double tipRate = .20;
double tip = (totalBill * tipRate);
double tax = (totalBill * taxRate);
double amountDue = (totalBill + tax + tip);
cout << "Total Bill: $" << totalBill << endl;
cout << "Tax: $" << tax << endl;
cout << "Tip: $" << tip << endl;
cout << "Total Amount Due: $" << amountDue << endl;
cout << "Enter ammount tendered: $";
cin >> amtTendered;
double changeDue = amtTendered - amountDue;
cout << "Change Due: $" << changeDue << endl;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.