Question

Due: Wednesday June 10, 2020 A travel company has many British travelers going to the US who would like to exchange their Bri
Heading 4 Normal Strong What follows is a sample of how the output of your program should look like upon execution. Hello, tr
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate the question. Thank You.

#include <iostream>
using namespace std;

int main()
{

   float exchangeRate = 1.26;
   cout<<"Hello Traveler."<<endl;
   cout<<"Please enter the number of British pounds you wish to convert to US dollars : ";
   float britishDollar;
   cin>>britishDollar;
   float usDollarsIn = britishDollar*exchangeRate;
   cout<<britishDollar<<" British Pounds are equal to $"<<usDollarsIn<<endl;

   cout<<"That is : "<<endl;

   float amount=2000;
   //to avoid float calculations
   int usDollars = usDollarsIn*100;


   int val = usDollars/amount;
   cout<<val<<"\t"<<"$20 bills"<<endl;
   usDollars = usDollars-val*amount;

   amount=1000;
   val = usDollars/amount;
   cout<<val<<"\t"<<"$10 bills"<<endl;
   usDollars = usDollars-val*amount;

   amount=500;
   val = usDollars/amount;
   cout<<val<<"\t"<<"$5 bills"<<endl;
   usDollars = usDollars-val*amount;

   amount=100;
   val = usDollars/amount;
   cout<<val<<"\t"<<"$1 bills"<<endl;
   usDollars = usDollars-val*amount;

   amount=25;
   val = usDollars/amount;
   cout<<val<<"\t"<<"quarters"<<endl;
   usDollars = usDollars-val*amount;

   amount=10;
   val = usDollars/amount;
   cout<<val<<"\t"<<"dimes"<<endl;
   usDollars = usDollars-val*amount;

   amount=5;
   val = usDollars/amount;
   cout<<val<<"\t"<<"nickels"<<endl;
   usDollars = usDollars-val*amount;

   val = usDollars;
   cout<<val<<"\t"<<"pennies"<<endl;

   if(usDollars>110){
       cout<<"Gift : Calendar"<<endl;
   }else if(usDollars>101){
       cout<<"Gift : pen"<<endl;
   }else{
       cout<<"Gift : None."<<endl;
   }
   return 0;
}

I change exchangeRate to 1.78 for below output

X ector sort Console X <terminated> cppProject Debug (C/C++ Application) C:\Users\Mohammad Shahrukh\Desktop\c_language_worksp

output with rate 1.26 is as below

ge vector sort Console X <terminated> cppProject Debug [C/C++ Application] C:\Users\Mohammad Shahrukh\Desktop\c_language_work

Add a comment
Know the answer?
Add Answer to:
Due: Wednesday June 10, 2020 A travel company has many British travelers going to the US...
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
  • (In Python 3) Write a program with total change amount as an integer input, and output...

    (In Python 3) Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 (or less than 0), the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes So...

  • it c++ coding. please write on atom software. 1. Write a program that converts dollars into coins a. Request a dolla...

    it c++ coding. please write on atom software. 1. Write a program that converts dollars into coins a. Request a dollar amount as an integer: $5.34 is input as 534 b. Use a constant variable to represent each coin as a fixed value: const int NICKEL 5; c. Use division and the mod function to calculate the number of each coin. Change Calculator Enter dollar amount (as an integer): $534 The equivalent in coins: 21 Quarters 0 Dimes 1 Nickels...

  • Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10...

    Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...

  • in C please! Proiect Overview: A business owner is unhappy with the services provided by the...

    in C please! Proiect Overview: A business owner is unhappy with the services provided by the government and has chosen to pay the tax using a combination of coins including quarters, dimes, nickels, and pennies. In this project, you are asked to write a program to analyze the tax payment in coins. Th nickels and pennies the owner has paid. It then computes the total amount of tax paid in dollars and cents, and computes the weight of all the...

  • write a PHP program makes change for a given number of cents. The program should ask...

    write a PHP program makes change for a given number of cents. The program should ask the user for the amount of cents and then output the change for specific denominations of ten dollar bills, five dollar bills, one dollar bills, quarters, dimes, nickels, and pennies. Here is a sample program output for an input of 265 cents: Change for 2 dollars and 65 cents : 0 ten dollar bills 0 five dollar bills 2 one dollar bills 2 quarters...

  • C++ HW Question Your program will simulate a simple change maker for a vending machine. It...

    C++ HW Question Your program will simulate a simple change maker for a vending machine. It will start with a stock of coins and dollars. It will then repeatedly request the price for an item to be purchased or to quit. If given a price, it will accept nickels, dimes, quarters, one-dollar and five-dollar bills—deposited one at a time—in payment. When the user has deposited enough to cover the cost of the item, the program will calculate the coins to...

  • in c code x Global Soccer 1.docx x Acceleration Due to 6 x M Inbox (5,949)...

    in c code x Global Soccer 1.docx x Acceleration Due to 6 x M Inbox (5,949) - joshfor x M Inbox (4,224) - joshuar X ® AC ads/ACFrOgA6UB 1k4Z1i1xGLNQ1Lntj510 lutEUaA..pdf ECE 175: Computer Programming for Engineering Applications Lab Assignment #2 (Thursday sessions) Relevant Programming Concepts: • Branch Structure • Loop Problem 1 (15 points): Develop a C program that asks a user to enter a total change amount in cents) and outputs the change using the fewest coins. The coin...

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
ADVERTISEMENT