subject
Computers and Technology, 28.07.2020 19:01 india73

C++ 1(A). Indicate which of the following is the function prototype, the function header, and the function call:
void showNum(double num)
void showNum(double);
showNum(45.67);
(B) The following program skeleton asks for the number of hours you’ve worked and your hourly pay rate. It then calculates and displays your wages. The function showDollars, which you are to write, formats the output of the wages.
#include
#include
using namespace std;
void showDollars(double pay); // Function prototype
int main()
{
double payRate, hoursWorked, wages;
cout << "How many hours have you worked? "
cin >> hoursWorked;
cout << "What is your hourly pay rate? ";
cin >> payRate;
wages = hoursWorked * payRate;
showDollars(wages);
return 0;
}
// Write the definition of the showDollars function here.
// It should have one double parameter and display the message
// "Your wages are $" followed by the value of the parameter.
(C) The following statement calls a function named half, which returns a value that is half that of the argument passed to it.
result = half(number);
Assume that result and number have both been defined to be double variables. Write the half function.
(D) A program contains the following function.
int cube(int num)
{
return num * num * num;
}
Write a statement that passes the value 4 to this function and assigns its return value to the variable result.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:20
What’s resistance in an electrical circuit ?
Answers: 1
question
Computers and Technology, 23.06.2019 15:20
In a game with three frames, where will the objects on layer 1 appear? a. next to the play area b. in the middle of the game c. behind everything else d. in front of everything else
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Does read theory have answers keys ?
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
You know the right answer?
C++ 1(A). Indicate which of the following is the function prototype, the function header, and the f...
Questions
question
English, 13.12.2021 23:50
question
Biology, 13.12.2021 23:50
question
Mathematics, 13.12.2021 23:50
question
Mathematics, 13.12.2021 23:50
question
Mathematics, 13.12.2021 23:50
Questions on the website: 13722361