Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Project.cpp : This file contains the 'main' function. Program execution begins and ends there.
- //
- #include <iostream>
- #include <string>
- #include "Item.h"
- CItem itemList[25];
- void showmenu(void);
- void passwordprotection(void);
- void selection(void);
- void DoInitializePriceList(void);
- void DoDisplayFullPriceList(void);
- void DoAddItemToList(void);
- void DoSetItemPrice(void);
- void DoSetItemDiscountRate(void);
- void DoDisplayItem(void);
- void DoOrderCost(void);
- void DoRemoveItemFromList(void);
- void DoQuit(void);
- using namespace std;
- int main()
- {
- int exit = 0;
- passwordprotection();
- while (exit == 0)
- {
- selection();
- }
- }
- void selection(void)
- {
- char selection = 0;
- cout << "\n\nPlease enter option number: ";
- cin >> selection;
- switch (selection)
- {
- default:
- {
- if (isdigit(selection))
- {
- cout << "\nThat is not a valid menu option" << endl;
- }
- else {
- cout << "\nThat is not a number" << endl;
- }
- break;
- }
- case 0: {
- showmenu(); break;
- }
- }
- return;
- }
- void showmenu(void)
- {
- cout << "\n\n1. Initialize Price List" << endl;
- cout << "2. Display Full Price List" << endl;
- cout << "3. Add Item to List" << endl;
- cout << "4. Set Item Price" << endl;
- cout << "5. Set Item Discount Rate" << endl;
- cout << "6. Display Item" << endl;
- cout << "7. Order Cost" << endl;
- cout << "8. Remove Item from List" << endl;
- cout << "0. Quit" << endl;
- }
- void passwordprotection(void)
- {
- string attempt;
- const string password = "password";
- cout << "\n\nPlease enter password: ";
- cin >> attempt;
- if (attempt == password)
- {
- return;
- }
- for (int i = 1; i < 3; i++)
- {
- cout << "\nPassword incorrect, please try again: ";
- cin >> attempt;
- if (attempt == password)
- {
- return;
- }
- }
- exit(0);
- }
- void DoInitializePriceList(void)
- {
- }
- void DoDisplayFullPriceList(void)
- {
- }
- void DoAddItemToList(void)
- {
- }
- void DoSetItemPrice(void)
- {
- }
- void DoSetItemDiscountRate(void)
- {
- }
- void DoDisplayItem(void)
- {
- }
- void DoOrderCost(void)
- {
- }
- void DoRemoveItemFromList(void)
- {
- }
- void DoQuit(void)
- {
- exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement