Computers and Technology
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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:50, najashohatee1234
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
image
Computers and Technology, 22.06.2019 11:30, neekWYB
Andrina writes letters that are regularly sent to hundreds of her company’s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
Answers: 1
image
Computers and Technology, 23.06.2019 06:20, Ab20600
Which text function capitalizes the first letter in a string of text? question 10 options: upper capital first proper
Answers: 1
image
Computers and Technology, 23.06.2019 12:30, umimgoingtofail
What is the difference between the internet and the world wide web?
Answers: 1
Do you know the correct answer?
C++ 1(A). Indicate which of the following is the function prototype, the function header, and the f...

Questions in other subjects:

Konu
Mathematics, 23.04.2021 20:30