Question: Create a program that has two functions: main and UStoCA main gets input from the user asking for a price (float) displays price before conversion

Create a program that has two functions: main and UStoCA

  • main
    • gets input from the user asking for a price (float)
    • displays price before conversion
    • calls function to convert
    • displays price after conversion
  • UStoCA
    • takes in price parameter (float)
    • converts to CAD (Canadian dollars)
      • current conversion:
      • 1 USD = 1.31 CAD (approximately)
    • returns converted price (float)

NOTE:

To print formatted decimals use:

  • Include this library:
    • #include 
  • Have this line at the beginning of main before output
    • cout << fixed << setprecision(2);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!