diff --git a/ProgrammingMB C++/ProgrammingMB.cbp b/ProgrammingMB C++/ProgrammingMB.cbp new file mode 100644 index 0000000..da8f131 --- /dev/null +++ b/ProgrammingMB C++/ProgrammingMB.cbp @@ -0,0 +1,40 @@ + + + + + + diff --git a/ProgrammingMB C++/ProgrammingMB.depend b/ProgrammingMB C++/ProgrammingMB.depend new file mode 100644 index 0000000..bbd5602 --- /dev/null +++ b/ProgrammingMB C++/ProgrammingMB.depend @@ -0,0 +1,4 @@ +# depslib dependency file v1.0 +1593806778 source:q:\c++\programmingmb\main.cpp + + diff --git a/ProgrammingMB C++/ProgrammingMB.layout b/ProgrammingMB C++/ProgrammingMB.layout new file mode 100644 index 0000000..8a88fcc --- /dev/null +++ b/ProgrammingMB C++/ProgrammingMB.layout @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ProgrammingMB C++/bin/Debug/ProgrammingMB.exe b/ProgrammingMB C++/bin/Debug/ProgrammingMB.exe new file mode 100644 index 0000000..fd6eef6 Binary files /dev/null and b/ProgrammingMB C++/bin/Debug/ProgrammingMB.exe differ diff --git a/ProgrammingMB C++/main.cpp b/ProgrammingMB C++/main.cpp new file mode 100644 index 0000000..bb6568f --- /dev/null +++ b/ProgrammingMB C++/main.cpp @@ -0,0 +1,46 @@ +#include + +using namespace std; + +int convert() +{ + double orig; + double converted; + int currency; + cout << "Enter the original amount (USD): "; + cin >> orig; + cout << "Enter the currency to convert to (1 = peso, 2 = rupee, 3 = pound, 4 = euro): "; + cin >> currency; + + switch(currency) { + case 1 : + converted = orig * 22.4; + break; + case 2: + converted = orig * 75.69; + break; + case 3: + converted = orig * 0.8; + break; + case 4: + converted = orig * 0.89; + break; + default: + cout << "Invalid value" << endl; + + } + cout << "The converted value is: " << converted << endl; + return 1; +} + +int main() +{ + char cont = 'y'; + while(cont == 'y'){ + convert(); + cout << endl; + cout << "Would you like to continue? Enter y or n: "; + cin >> cont; + } + return 0; +} diff --git a/ProgrammingMB C++/main.cpp.save b/ProgrammingMB C++/main.cpp.save new file mode 100644 index 0000000..8d5e326 --- /dev/null +++ b/ProgrammingMB C++/main.cpp.save @@ -0,0 +1,55 @@ +#include + +using namespace std; + +int convert() +{ + double orig; + double converted; + int currency; + cout << "Enter the original amount (USD): "; + cin >> orig; + cout << "Enter the currency to convert to (1 = peso, 2 = rupee, 3 = pound, 4 = euro): "; + cin >> currency; + + switch(currency) { + case 1 : + converted = orig * 22.4; + break; + case 2: + converted = orig * 75.69; + break; + case 3: + converted = orig * 0.8; + break; + case 4: + converted = orig * 0.89; + break; + default: + cout << "Invalid value" << endl; + + } + cout << "The converted value is: " << converted << endl; + return 1; +} + +int main() +{ + bool cont = true; + char contcheck; + + while(cont ){ + convert(); + cout << endl; + cout << "Would you like to continue? Enter y or n: "; + cin >> contcheck; + + if(contcheck = 'y'){ + cont = true; + } else{ + cont = false; + } + } + + return 0; +} diff --git a/ProgrammingMB C++/obj/Debug/main.o b/ProgrammingMB C++/obj/Debug/main.o new file mode 100644 index 0000000..ab075e6 Binary files /dev/null and b/ProgrammingMB C++/obj/Debug/main.o differ