Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started