Rav4s
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with
155 additions and
0 deletions
-
ProgrammingMB C++/ProgrammingMB.cbp
-
ProgrammingMB C++/ProgrammingMB.depend
-
ProgrammingMB C++/ProgrammingMB.layout
-
BIN
ProgrammingMB C++/bin/Debug/ProgrammingMB.exe
-
ProgrammingMB C++/main.cpp
-
ProgrammingMB C++/main.cpp.save
-
BIN
ProgrammingMB C++/obj/Debug/main.o
|
|
@ -0,0 +1,40 @@ |
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
|
|
|
|
|
<CodeBlocks_project_file> |
|
|
|
|
|
<FileVersion major="1" minor="6" /> |
|
|
|
|
|
<Project> |
|
|
|
|
|
<Option title="ProgrammingMB" /> |
|
|
|
|
|
<Option pch_mode="2" /> |
|
|
|
|
|
<Option compiler="gcc" /> |
|
|
|
|
|
<Build> |
|
|
|
|
|
<Target title="Debug"> |
|
|
|
|
|
<Option output="bin/Debug/ProgrammingMB" prefix_auto="1" extension_auto="1" /> |
|
|
|
|
|
<Option object_output="obj/Debug/" /> |
|
|
|
|
|
<Option type="1" /> |
|
|
|
|
|
<Option compiler="gcc" /> |
|
|
|
|
|
<Compiler> |
|
|
|
|
|
<Add option="-g" /> |
|
|
|
|
|
</Compiler> |
|
|
|
|
|
</Target> |
|
|
|
|
|
<Target title="Release"> |
|
|
|
|
|
<Option output="bin/Release/ProgrammingMB" prefix_auto="1" extension_auto="1" /> |
|
|
|
|
|
<Option object_output="obj/Release/" /> |
|
|
|
|
|
<Option type="1" /> |
|
|
|
|
|
<Option compiler="gcc" /> |
|
|
|
|
|
<Compiler> |
|
|
|
|
|
<Add option="-O2" /> |
|
|
|
|
|
</Compiler> |
|
|
|
|
|
<Linker> |
|
|
|
|
|
<Add option="-s" /> |
|
|
|
|
|
</Linker> |
|
|
|
|
|
</Target> |
|
|
|
|
|
</Build> |
|
|
|
|
|
<Compiler> |
|
|
|
|
|
<Add option="-Wall" /> |
|
|
|
|
|
<Add option="-fexceptions" /> |
|
|
|
|
|
</Compiler> |
|
|
|
|
|
<Unit filename="main.cpp" /> |
|
|
|
|
|
<Extensions> |
|
|
|
|
|
<lib_finder disable_auto="1" /> |
|
|
|
|
|
</Extensions> |
|
|
|
|
|
</Project> |
|
|
|
|
|
</CodeBlocks_project_file> |
|
|
@ -0,0 +1,4 @@ |
|
|
|
|
|
# depslib dependency file v1.0 |
|
|
|
|
|
1593806778 source:q:\c++\programmingmb\main.cpp |
|
|
|
|
|
<iostream> |
|
|
|
|
|
|
|
|
@ -0,0 +1,10 @@ |
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
|
|
|
|
|
<CodeBlocks_layout_file> |
|
|
|
|
|
<FileVersion major="1" minor="0" /> |
|
|
|
|
|
<ActiveTarget name="Debug" /> |
|
|
|
|
|
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |
|
|
|
|
|
<Cursor> |
|
|
|
|
|
<Cursor1 position="871" topLine="28" /> |
|
|
|
|
|
</Cursor> |
|
|
|
|
|
</File> |
|
|
|
|
|
</CodeBlocks_layout_file> |
|
|
@ -0,0 +1,46 @@ |
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
} |
|
|
@ -0,0 +1,55 @@ |
|
|
|
|
|
#include <iostream> |
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
} |