aboutsummaryrefslogtreecommitdiff
path: root/CST 126/Homework 1
diff options
context:
space:
mode:
authorChanin Timbal <[email protected]>2024-04-27 14:05:17 -0700
committerChanin Timbal <[email protected]>2024-04-27 14:05:17 -0700
commitf94af69b62058b241e569b973a136afb4d331d46 (patch)
tree6333c9062e329593e5d7cae8a1c94bc46391a426 /CST 126/Homework 1
parentCompleted Program of Currency Conversion (diff)
downloadhomework-1-chaninnohea-f94af69b62058b241e569b973a136afb4d331d46.tar.xz
homework-1-chaninnohea-f94af69b62058b241e569b973a136afb4d331d46.zip
Homework 2 first commit
Diffstat (limited to 'CST 126/Homework 1')
-rw-r--r--CST 126/Homework 1/main.cpp49
1 files changed, 46 insertions, 3 deletions
diff --git a/CST 126/Homework 1/main.cpp b/CST 126/Homework 1/main.cpp
index 8d10dad..a82ca3b 100644
--- a/CST 126/Homework 1/main.cpp
+++ b/CST 126/Homework 1/main.cpp
@@ -11,6 +11,7 @@ using std::cout;
using std::cin;
//Protoypes
+void display_options();
float convert(float input, float output, float amount);
void run_conversion(char again);
void currency_menu();
@@ -18,15 +19,57 @@ void currency_menu();
//Main to run the program
int main()
{
- char again = 'Y';
+ int option = 0;
- cout << "Welcome to my currency conversion tool!\n";
+ cout << "Welcome! Please choose an option: \n";
+ display_options();
+ cin >> option;
+ cin.ignore(100, '\n');
- run_conversion(again);
+ while (option != 0)
+ {
+ if (option == 1)
+ {
+ char again = 'Y';
+ run_conversion(again);
+ cin >> again;
+ cin.ignore(100,'\n');
+ }
+
+ else if (option == 2)
+ {
+
+ }
+
+ else if (option == 3)
+ {
+
+ }
+ else
+ {
+ cout << "That is not one of the options!";
+ display_options();
+ cin >> option;
+ cin.ignore(100, '\n');
+ }
+
+ display_options();
+ cin >> option;
+ cin.ignore(100, '\n');
+ }
return 0;
}
+//menu options
+void display_options()
+{
+ cout << "1. Currency Converter\n";
+ cout << "2. Guessing Game\n";
+ cout << "3. Temperature Logger\n";
+ cout << "0. Quit\n";
+}
+
//Conversion Calculator
float convert(float input, float output, float amount)
{