Answer to Question #264247 in C++ for Kashce

Question #264247

Make a program that will input Philippine currency (Peso), convert it into Dollar. 1 Dollar 49.50 pesos, Display the Dollar equivalent. Your program will be terminated if the peso currency = 0.


1
Expert's answer
2021-11-11T00:06:23-0500
#include <iostream>


int main()
{
    const double rates = 49.50;
    double dollar;
    std::cout << "This program converts dollars to pesos" << "\n";
    std::cout << "Enter 0 to complete the conversion process" << "\n";
    std::cout << "Current exchange rate: 1 Dollar = " << rates << " Pesos" << "\n";
    for (;;) 
    {
        std::cout << "Enter the amount of dollars: ";
        std::cin >> dollar;
        if (dollar == 0)
            break;
        if (dollar < 0)
            std::cout << "Negative value entered" <<"\n";
        else
            std::cout << dollar <<" Dollars = " << dollar*rates<< " Pesos" << "\n";
    }
    return 0;
}

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
APPROVED BY CLIENTS