Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //This is a currency converter. I am going to only make it be able to convert MYR(my currency) to USD
- //May change due to inflation
- //Accurate as of 7/1/2022
- using namespace std;
- int main() {
- int RmPerUSD = .23;
- int UsdPerRm = 4.40;
- string ConversionMethod;
- bool Running = true;
- while (Running == true) {
- cout<<"Conversion method(MYR>USD,USD>MYR)>"; cin >> ConversionMethod;
- cout << "Note: It doesnt NOT like outputting decimal points." << endl;
- if (ConversionMethod == "MYR>USD") {
- int MYR;
- cout << "MYR value>"; cin >> MYR;
- cout << "Answer:" << MYR / UsdPerRm << endl;
- }
- else if (ConversionMethod == "USD>MYR") {
- int usd;
- cout << ">"; cin >> usd;
- cout << "Answer" << usd / RmPerUSD << endl;
- }else {
- cout << "Syntax error: Not a recognized command" << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement