Question

Write a program that will convert U.S. dollar amounts to Japanese yen and to euros, storing...

Write a program that will convert U.S. dollar amounts to Japanese yen and to euros, storing the conversion factors in the constants YEN_PER_DOLLAR and EUROS_PER_ DOLLAR. To get the most up-to-date exchange rates, search the Internet using the term “currency exchange rate”. If you cannot find the most recent exchange rates, use the following:

1 Dollar = 98.93 Yen

1 Dollar = 0.74 Euros

Format your currency amounts in fixed-point notation, with two decimal places of precision, and be sure the decimal point is always displayed.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>
int main()
{
   //Define constant for current exchange rate
   const float YEN_PER_DOLLAR   = 106.84;
   const float EUROS_PER_DOLLAR = 0.81;
   float dollar = 0; //Define a varible to take user input
   printf("How much U.S. Dollar ?\n"); //Ask user for input
   scanf("%f", &dollar); // Read input
   //Calculate yen and euros by multiplying dollar * per_dollar value
   printf(" %0.2f Dollar = %0.2f Yen\n",   dollar, dollar * YEN_PER_DOLLAR);
   printf(" %0.2f Dollar = %0.2f Euros\n", dollar, dollar * EUROS_PER_DOLLAR);
}


Note : The program is done under linux environment using C programming language. Ping me for doubts or if you need this program in some other programming language. Thanks. Please note that %0.2f is used to display only 2 digits after the decimal point.

Add a comment
Know the answer?
Add Answer to:
Write a program that will convert U.S. dollar amounts to Japanese yen and to euros, storing...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • write a Java console application that converts between currencies US Dollar ($), Euro (€), and Japanese...

    write a Java console application that converts between currencies US Dollar ($), Euro (€), and Japanese Yen (¥). Prompt the user for a conversion code: Code   Conversion   Last run input a   US Dollar  Euro   32 b   US Dollar  Japanese Yen   64 c   Euro  US Dollar    200 d   Euro  Japanese Yen    300 e   Japanese Yen  US Dollar   24 f   Japanese Yen  Euro   28 x   Exit   Then prompt and get from the user a...

  • The annualized forward when the Japanese yen/U.S. dollar exchange rates are JPY118.25 per USD spot and...

    The annualized forward when the Japanese yen/U.S. dollar exchange rates are JPY118.25 per USD spot and JPY116.85 per USD quoted on a one month forward contract is discount; 10.44% O premium: 7.28% discount: 14.21% O premium; 12.41%.

  • Consider the data in the table below: Nominal Exchange Rates for the U.S. Dollar Country Foreign...

    Consider the data in the table below: Nominal Exchange Rates for the U.S. Dollar Country Foreign currency/U.S. dollar U.S. dollars/foreign currency United Kingdom (pound) 0.641 1.559 Canada (Canadian dollar) 1.008 0.992 Mexico (peso) 12.39 0.081 Japan (yen) 83.338 0.012 European Union (euro) 0.756 1.322 a. Calculate the nominal exchange rate between the Mexican peso and the Japanese yen. Express in two ways. Instructions: Enter your responses rounded to three decimal places. One peso = ___ yen One yen = ___...

  • Use the following spot and forward​ bid-ask rates for the Japanese​ yen/U.S. dollar​ (¥/$) exchange rate...

    Use the following spot and forward​ bid-ask rates for the Japanese​ yen/U.S. dollar​ (¥/$) exchange rate from September​ 16, 2010, to answer the following​ questions: a. What is the annual forward premium on the yen for all​ maturities? (Assume that the U.S. dollar is the home currency. Also use the​ Mid-Rate values computed in part​ a.) b. Which maturities have the smallest and largest forward​ premiums? Period ¥/$ Bid Rate ¥/$ Ask Rate spot 85.99 86.03 1 month 85.61 85.66...

  • For the first three questions consider the U.S.- Japan exchange rate, expressed as yen per dollar....

    For the first three questions consider the U.S.- Japan exchange rate, expressed as yen per dollar. Using the basic supply and demand diagram as illustrated at the beginning of Week 9 lecture slides, answer the following: 1. Other things being equal, an increase in the Japanese price level will shift the supply curve of dollars_________, the demand curve for dollars__________ and cause the dollar to ________. a. rightward, leftward, depreciate b. leftward, rightward, depreciate c. leftward, rightward, appreciate d. rightward,...

  • On July 15, 2016, you convert 670,000 U.S. dollars to Japanese yen in the spot foreign...

    On July 15, 2016, you convert 670,000 U.S. dollars to Japanese yen in the spot foreign exchange market and purchase a six-month forward contract to convert yen into dollars. How much will you receive in US dollars at the end of six months? Use the data in Table 9-1 for this problem. (Round your answer to 2 decimal places. (e.g. 32.16)) Amount that you will receive in U.S. dollars at the end of six months Prev Next > PER US$...

  • DQuestion 36 2 pts The following table shows the number of U.S. dollars required to buy...

    DQuestion 36 2 pts The following table shows the number of U.S. dollars required to buy one British pound and the number of U.S. dollars required to buy one euro between February 1, 2016, and September 1, 2016: U.S. Dollars Required U.S. Dollars to Buy 1 British Pound 1.429 Required to Buy 1 Euro 1.1092 Date February 1, 2016 March 1, 2016 1.425 April 1, 2016 1.432 May 1, 20161.452 June 1, 2016 1.420 July 1, 20161.313 August 1, 2016...

  • Volkswagen's Hedging Strategy 1. Why did Volkswagen suffer a 95% drop in its 4th quarter, 2003 pr...

    Volkswagen's Hedging Strategy 1. Why did Volkswagen suffer a 95% drop in its 4th quarter, 2003 profits? 2. Do you think the Volkswagen’s decision to hedge only 30% of its anticipated U.S. sales was a good? Why or why not? 3. Do you think the Volkswagen’s decision to revert back to hedging 70% of its foreign currency exposure was a good decision? Why or why not? Embraer and the Wild Ride of the Brazilian Real 4. Is a decline in...

  • Please help me to solve these two problems showing all the calculations, no excel please 466-566-P12020(2)...

    Please help me to solve these two problems showing all the calculations, no excel please 466-566-P12020(2) - Protected View - Saved to this PC 18109361685 A Share P Comments Mailings P Tell me what you want to do File Draw Design References View Help Home Insert Layout Review Please prepare according to the "Problem Set Guidelines" in the "Course Documents" section, and submit your solutions in the Assignments section of Blackboard by Sunday, January 19 at 11:59 p.m. There is...

  • 15 Suppose that the current exchange rate is €1.00 - $1.60. The indirect quote from the...

    15 Suppose that the current exchange rate is €1.00 - $1.60. The indirect quote from the US. perspective is A) €0.6250 - $1.00 3) €1.50 - $1.00 €1.00 - $1.60 Dy none of the options 19) The bid price A) is the price that a dealer stands ready to pay B) is the price that a dealer stands ready to sell at. is the price that the dealer has just paid for something, his historical cost of the most recent...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT