aboutsummaryrefslogtreecommitdiff
path: root/CST 126/Homework 1/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST 126/Homework 1/main.cpp')
-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)
{