Question No.6
6. On a certain day the British pound was equivalent to $1.487 U.S., the French franc was $0.172,
the German deutschemark was $0.584, and the Japanese yen was $0.00955. Write a program that
allows the user to enter an amount in dollars, and then displays this value converted to these four
other monetary units.
ANSWER BY WAJID
#include
#include
#define pound 1.487
#define franc 0.172
#define deutschemark 0.584
#define yen 0.00955
void main(void)
{
int dollars;
do{
cout<<"Enter the U.S. amout : \xdb\t"; cin >>dollars;
cout<
cout<<"British pound =\t" << dollars / pound <
cout<<"French franc =\t" << dollars / franc <
cout<<"German deutschemark =\t" << dollars / deutschemark <
cout<<"Japanese yen =\t" << dollars / yen <
//cout<<"\nAnother operation ? (y/n) : "; //use this line to continue using the programme.
cout<<"\n !Press c to continue or any key to exit."<
}while(getch()=='c');
}
the German deutschemark was $0.584, and the Japanese yen was $0.00955. Write a program that
allows the user to enter an amount in dollars, and then displays this value converted to these four
other monetary units.
ANSWER BY WAJID
#include
#include
#define pound 1.487
#define franc 0.172
#define deutschemark 0.584
#define yen 0.00955
void main(void)
{
int dollars;
do{
cout<<"Enter the U.S. amout : \xdb\t"; cin >>dollars;
cout<
cout<<"\n !Press c to continue or any key to exit."<
}
No comments:
Post a Comment