diff options
author | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
---|---|---|
committer | msglm <msglm@techchud.xyz> | 2023-01-14 05:31:48 -0600 |
commit | 9d53d8857eaa1c9405894a88ca75bc4657e42f35 (patch) | |
tree | eb1efc1d028b949dd83bb710c68be8eff58f26e7 /C++/TakeOrderV1 | |
download | school-code-9d53d8857eaa1c9405894a88ca75bc4657e42f35.tar.gz school-code-9d53d8857eaa1c9405894a88ca75bc4657e42f35.tar.bz2 school-code-9d53d8857eaa1c9405894a88ca75bc4657e42f35.zip |
Diffstat (limited to 'C++/TakeOrderV1')
-rw-r--r-- | C++/TakeOrderV1/.~lock.Take Order Program Instructions (v1).docx# | 1 | ||||
-rw-r--r-- | C++/TakeOrderV1/Take Order Program Instructions (v1).docx | bin | 0 -> 126173 bytes | |||
-rw-r--r-- | C++/TakeOrderV1/TakeOrderV1.cpp | 101 |
3 files changed, 102 insertions, 0 deletions
diff --git a/C++/TakeOrderV1/.~lock.Take Order Program Instructions (v1).docx# b/C++/TakeOrderV1/.~lock.Take Order Program Instructions (v1).docx# new file mode 100644 index 0000000..708010e --- /dev/null +++ b/C++/TakeOrderV1/.~lock.Take Order Program Instructions (v1).docx# @@ -0,0 +1 @@ +,msglm,msglm-laptop,04.04.2022 12:07,file:///home/msglm/.config/libreoffice/4;
\ No newline at end of file diff --git a/C++/TakeOrderV1/Take Order Program Instructions (v1).docx b/C++/TakeOrderV1/Take Order Program Instructions (v1).docx Binary files differnew file mode 100644 index 0000000..28fa77f --- /dev/null +++ b/C++/TakeOrderV1/Take Order Program Instructions (v1).docx diff --git a/C++/TakeOrderV1/TakeOrderV1.cpp b/C++/TakeOrderV1/TakeOrderV1.cpp new file mode 100644 index 0000000..23fb08a --- /dev/null +++ b/C++/TakeOrderV1/TakeOrderV1.cpp @@ -0,0 +1,101 @@ +// Name: msglm +// Date: +// Program Name: +// Description: + + +#include <iostream> +#include <string> +#include <iomanip> +using namespace std; + +// Named constants + +int main() { + + //Variable declaration + int items; + int menuNum; + char size; + string curItem; + string curSize; + float price; + //Program title and description for the user + cout << "Welcome to Anonymous's Dine and Shine" << endl << endl; + + //User Information + cout << "Menu: \n"; + cout << "1 - Burger\n"; + cout << "2 - Fries\n"; + cout << "3 - Drink\n"; + + cout << "Sizes: \n"; + cout << "S - Small $4.25\n"; + cout << "M - Medium $5.50\n"; + cout << "L - Large $7.50\n"; + + // User input + cout << "How many items would you like to buy?: "; + cin >> items; + + for (int itemNum = 1; itemNum <= items; itemNum++) { + cout << "Order Number " << itemNum << endl; + + //User input + cout << "Enter the menu number for your item: \n"; + cin >> menuNum; + cout << "Enter the size of that item: \n"; + cin >> size; + + //Price and String Output figuring + switch(menuNum) { + case 1: + curItem = "Burger"; + break; + case 2: + curItem = "Fries"; + break; + case 3: + curItem = "Drink"; + break; + default: + cout << "Invalid Entry. Terminating"; + return 1; + } + + switch(size) { + case 's': + case 'S': + curSize = "Small"; + price = price + 4.25; + break; + case 'm': + case 'M': + curSize = "Medium"; + price = price + 5.50; + break; + case 'l': + case 'L': + curSize = "Large"; + price = price + 7.50; + break; + default: + cout << "Invalid Entry. Terminating"; + return 1; + } + + cout << "For Order " << itemNum << " you ordered a " << curSize << " " << curItem << endl; + + } + //Output Prices + cout << "Sub Total: " << setprecision(3) << price << endl; + cout << "Tax: " << setprecision(3) << price*0.10 << endl; + cout << "Total: " << setprecision(3) << price+(price*0.10) << endl; +} + +/*This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + |