Answer to Question #279457 in C++ for Kyut

Question #279457

One (1) euro is equivalent to fifty five (55) pesos and one (1) dollar is equivalent to 44 pesos. Write a program



that converts dollar to euro. The program should ask the user to input an amount in dollar and display the



equivalent amount in euro. Use a function for the conversion. Allow the user to repeat as often as the user



wants.




1
Expert's answer
2021-12-15T02:09:00-0500
#include <bits/stdc++.h>
using namespace std;


void conversion()
{
    double dollar, euro;
    
    cout<<"Input an amount in dollar: ";
    
    cin>>dollar;
    
    
    euro = (dollar * 44) / 55 ;
    
    cout<<"Amount in Euro is: "<<euro<<endl;
    
    
    
    
}


int main()
{
    int a;
    
    cout << "Press 1 for conversion.\nPress 2 for exit the program."<<endl;
    
    cin >> a;
    
    if (a == 1)
    {
        conversion();
        
        
    }
    else{
        exit;
    }
}









Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog