Problem 11 - Currency Write a program that will convert U.S. dollar amounts toJa
ID: 3609626 • Letter: P
Question
Problem 11 - Currency Write a program that will convert U.S. dollar amounts toJapanese Yen and to Euros. To get the most up-to-date exchangerates, search the Internet using the term "currency exchange rate".If you cannot find the most recent exchange rates, use thefollowing: 1 Dollar = 113.22 Yen 1 Dollar = 0.6936 Euros Format your currency amounts in fixed-point notation, with twodecimal points of precision, and be sure the decimal point isalways displayed. Problem 11 - Currency Write a program that will convert U.S. dollar amounts toJapanese Yen and to Euros. To get the most up-to-date exchangerates, search the Internet using the term "currency exchange rate".If you cannot find the most recent exchange rates, use thefollowing: 1 Dollar = 113.22 Yen 1 Dollar = 0.6936 Euros Format your currency amounts in fixed-point notation, with twodecimal points of precision, and be sure the decimal point isalways displayed.Explanation / Answer
Dear... #include <stdio.h>#include <ctype.h>
int main(void)
{
float conversion=0.0f;
float Yen = 113.22f;
float Euro = 0.6936f; float USD = 1.00f;
char ch;
while (ch!='X') {
printf(" U.S. Dollars CurrencyConversion Menu. "); printf("-------------------------------------- ");
printf("A. 113.22 Japanese Yen = 1 U.S.Dollar "); printf("B. 0.6936 EU Euro = 1 U.S.Dollar "); printf("X. Exit "); fflush( stdin ); printf(" Enter A,B,C,D,E or X:"); ch=toupper(getchar()); switch(ch)
{ case 'A': case'B': printf("-------------- "); printf(" Please enter a USDollar Amount: $ "); scanf("%f",&conversion); printf(" %.2f U.S. Dollarsequal ",conversion); switch(ch) { case 'A': printf("%.2fYen ",conversion*Yen); break; case 'B': printf("%.2fEuro ",conversion*Euro); break; default : printf("-------------- "); printf(" Enter in A,B, of the currencyyou would like "); printf("to convert from U.S. Dollarsor enter X to Exit ");
}
}
}
scanf("%c ");
return 0; } I hope it is usefull toyou.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.