Question
In C++, I'm compiling mainly in Visual Studios Q1) Write a PROGRAM that has function named timesTen. The function should accept a double argument, and
In C++, I'm compiling mainly in Visual Studios
Q1) Write a PROGRAM that has function named timesTen. The function should accept a double argument, and return a double value that is ten times the value of the argument. Call the function in main and display the results to the screen.
Q2) Write a PROGRAM that has a function called findAverage that takes as arguments 4 integers and returns the average (a double). Call the function in main, ask the user for the 4 integers and then pass them to the function. After calling the function, display the average on the screen.
Q3) The distance a vehicle travels can be calculated as follows:
Distance = Speed * Time
Write a function named calDistance that accepts a vehicles speed and time as arguments, and returns the distance the vehicle has traveled. Call the function in main and display the results to the screen.
Q4) The formula for converting a temperature from Centigrade to Fahrenheit is:
F = 9\5 * C + 32
Where F is the Fahrenheit temperature and C is the centigrade temperature. Write a function named fahrenheit that accepts a centigrade temperature as an argument. The function should return the temperature, converted to Fahrenheit. Demonstrate the function (in main) by calling it in a loop that displays a table of the Centigrade temperature 0 through 20 and their Fahrenheit equivalents, i.e. call the function inside the loop!
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