Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

Students also viewed these Databases questions

Question

What does this public know about your organization?

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago