这个 C 语言问题要怎么回答 If you can help me,please write down your program.Thanks!Write the program rates which should convert Macau Patacas into following four currencies:USD,HKD,RMB,Euro.The program should receive a Pataca amount from t

来源:学生作业帮助网 编辑:作业帮 时间:2024/08/06 15:21:23
这个 C 语言问题要怎么回答 If you can help me,please write down your program.Thanks!Write the program rates which should convert Macau Patacas into following four currencies:USD,HKD,RMB,Euro.The program should receive a Pataca amount from t
xT[k@+cKeWBnvmAR-"2M&d&N&-"T'`U"(">z\6iAegϙܾr㯟"?|noN޼=;C7m"db'Z4 b*8;[ᕻZ8$@  y2. 6qְ3D. =͈sBMKڍ[Kum9 *$91''IYD9nɿ<*/s($ajA S.0r#`V f_UPQ숚e`4 ܁\Xd#bNብG!C(dӌ!Y -MV|rSS$")0]֌<Ȍk:L ~C>qrH F ɶ DQq{tD$n zG j1EC! Cj4ie(n3-e@n eKh7MX"KQK 0|(0a69ӸGHH`&ga]mc>RBrܢk+k8RWpi5 un҅0/]:9sSzc65 d53f3 }5"꺓B_.5"FeSYyc} Ic&O|> n`\p#CJn=gQ1&ƩhPX`圂BP`&1*.NB"h6zNnUɧ$0ry2S4bE-k$asUgz$$sI0pP

这个 C 语言问题要怎么回答 If you can help me,please write down your program.Thanks!Write the program rates which should convert Macau Patacas into following four currencies:USD,HKD,RMB,Euro.The program should receive a Pataca amount from t
这个 C 语言问题要怎么回答 If you can help me,please write down your program.Thanks!
Write the program rates which should convert Macau Patacas into following four currencies:USD,HKD,RMB,Euro.The program should receive a Pataca amount from the user and print the equivalent rate in the other currencies.The program should have one function for each currency that Patacas are converted into; so it should have the functions mop_usd,mop_hkd,mop_rmb,and mop_euro.These functions should receive an amount in Patacas as input,and produce the converted amount as their return value.Your program should use following exchange rates (amount in foreign currency for 1 Macau Pataca):
Currency Rate
USD 0.12503
HKD 0.96946
RMB 0.83502
Euro 0.09225
Define the exchange rates as constants in your program using #define statements (macros).
Example:
Currency exchange rates for Macau Patacas (MOP)
Enter amount in MOP:650
650.00 MOP is equivalent to:
USD 81.27
HKD 630.15
RMB 542.76
Euro 59.96

这个 C 语言问题要怎么回答 If you can help me,please write down your program.Thanks!Write the program rates which should convert Macau Patacas into following four currencies:USD,HKD,RMB,Euro.The program should receive a Pataca amount from t
#include
#include
#define USD 0.12503
#define HKD 0.96946
#define RMB 0.83502
#define EURO 0.09225
float mop_usd(float);
float mop_hkd(float);
float mop_rmb(float);
float mop_euro(float);
int main(void)
{
float mop;
printf("Currency exchange rates for Macau Patacas (MOP)\n");
printf("Eneter amount in MOP:");
scanf("%f",&mop);
printf("%f MOP is equivalent to:\n",mop);
printf("USD %.2f\n",mop_usd(mop));
printf("HKD %.2f\n",mop_hkd(mop));
printf("RMB %.2f\n",mop_rmb(mop));
printf("EURO %.2f\n",mop_euro(mop));
return 0;
}
float mop_usd(float mop)
{
return mop*USD;
}
float mop_hkd(float mop)
{
return mop*HKD;
}
float mop_rmb(float mop)
{
return mop*RMB;
}
float mop_euro(float mop)
{
return mop*EURO;
}
你要的应该是这个样子的.