Question

1. Write a statement that calls a function named showSquare, passing the value 10 as an...

1. Write a statement that calls a function named showSquare, passing the value 10 as an argument.

2. Write the function prototype for a function called showSquare. The function should have a single parameter variable of the int data type and areturn type of void.

3. Write the function prototype for a function called showScoreswith a parameter list containing four integer variables and a return type of void.

4. Look at the following function definition:
double getGrossPay(int hoursWorked, double payRate)
{
return payRate * hoursWorked;
}
Write a statement that will call the function passing the values 20 and 12.75 as arguments.

5. A program contains the following function definition:
int cube(int number)
{
return number * number * number;
}
Write a statement that calls this function, passing the value 4 as an argument, and assigns the function's return value to the variable result.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1)
showSquare(10);

2)
void showSquare(int);

3)
void showScores(int, int, int, int);

4)
getGrossPay(20, 12.75);

5)
result = cube(4);
Add a comment
Know the answer?
Add Answer to:
1. Write a statement that calls a function named showSquare, passing the value 10 as an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A(n) is a piece of data that is sent to a function when the function is...

    A(n) is a piece of data that is sent to a function when the function is called. argument parameter packet code All of these are true A variable is declared outside all functions. local global floating-point counter None of these Look at the following function prototype, int myFunecion(double); What is the data type of the function's return value? inc double void Can't tell from the prototype Look at the following function prototype. int myFunction(double, double, double); How many parameter variables...

  • Write a statement that calls a function named IncreaseItemQty, passing the variable addStock. Assign notebookInfo with...

    Write a statement that calls a function named IncreaseItemQty, passing the variable addStock. Assign notebookInfo with the value returned by IncreaseItemQty. #include <stdio.h> #include <string.h> typedef struct ProductInfo_struct {    char itemName[30];    int itemQty; } ProductInfo; ProductInfo IncreaseItemQty (ProductInfo productToStock, int increaseValue) {    productToStock.itemQty = productToStock.itemQty + increaseValue;    return productToStock; } int main(void) {    ProductInfo notebookInfo;    int addStock = 10;    scanf("%s", notebookInfo.itemName);    scanf("%d", &notebookInfo.itemQty);    /* Your solution goes here */    printf("Name:...

  • Write a statement that calls a function named IncreaseltemQty, passing the variable addQty. Assign notebooklnfo with the value returned by IncreaseltemQty 9 ProductInfo IncreaseItemQty (ProductInfo p...

    Write a statement that calls a function named IncreaseltemQty, passing the variable addQty. Assign notebooklnfo with the value returned by IncreaseltemQty 9 ProductInfo IncreaseItemQty (ProductInfo productToStock, int increaseValue) productToStock.itenQty = productToStock. ItemQty + increaseValue; 12 return productToStock 14 15 int main(void) ProductInfo notebookInfo int addQty; 16 17 19 addQty 1e; 20 21 scanf("%s", scanf("%d.. , notebookInfo . ItemName); &notebookInfo.itemQty); 22 24 productInfo-IncreaseItemQty (productInfo, addstock) Your solution goes here/ 25 26 printf("Name : %s, stock: %d\n", notebookInfo.itemName, notebookInfo.itenQty); 27 return ;...

  • Write a statement that declares a prototype for a function divide that takes four arguments and...

    Write a statement that declares a prototype for a function divide that takes four arguments and returns no value. The first two arguments are of type int. The last two arguments arguments are pointers to int that are set by the function to the quotient and remainder of dividing the first argument by the second argument. The function does not return a value. (C Program)

  • Write a full class definition for a class named Player , and containing the following members: A data member name of t...

    Write a full class definition for a class named Player , and containing the following members: A data member name of type string . A data member score of type int . A member function called setName that accepts a parameter and assigns it to name . The function returns no value. A member function called setScore that accepts a parameter and assigns it to score . The function returns no value. A member function called getName that accepts no...

  • 1. A(n) ____________________ is a variable or expression listed in a call to a function. 2....

    1. A(n) ____________________ is a variable or expression listed in a call to a function. 2. The pass by ____________________ mechanism must be used if the calling code is to receive information back from the function. 3. True or False? If there are several items in a parameter list, the compiler matches the parameters and arguments by their relative positions in the parameter and argument lists. 4. True or False? In C++, a function definition may have another function definition...

  • answer in c++ Using the table below, complete the C++ code to write the function prototype...

    answer in c++ Using the table below, complete the C++ code to write the function prototype statement, and the void function header. The void function should receive three double variables: the first two by value and the last one by reference. Name the formal parameters num1, num2 and answer. The function should divide the num1 variable by the num2 variable and then store the result in the answer variable. Name the function calcQuotient. Also write an appropriate function prototype for...

  • C++ The Function's Specification You will be writing a function with this specification: void quicksort void*...

    C++ The Function's Specification You will be writing a function with this specification: void quicksort void* base size t n, size t bytes, int compar (const void* const void*) Precondition base is a pointer to the first component of an array with at least n elements The component type of the array may be any type at all, and the parameter bytes must be the number of bytes in each component of the array. The fourth parameter compar, must be...

  • Need help problem 9-13 C++ Homework please help WRITE FUNCTION PROTOTYPES for the following functions. The...

    Need help problem 9-13 C++ Homework please help WRITE FUNCTION PROTOTYPES for the following functions. The functions are described below on page 2. (Just write the prototypes) When necessary, use the variables declared below in maino. mm 1.) showMenu m2.) getChoice 3.) calcResult m.) showResult 5.) getInfo mm.) showName 7.) calcSquare 8.) ispositive int main { USE THESE VARIABLES, when needed, to write function prototypes (#1 - #8) double num1 = 1.5; double num2 = 2.5; char choice; double result;...

  • 3. (12) Write a function named getSumSquares. You can skip writing the function prototype. This function...

    3. (12) Write a function named getSumSquares. You can skip writing the function prototype. This function has two int arguments called first and last. The function is to add up the tube of each number from first to last and return the total. (Note: the easy way to get the square of a number a is with: a * a). Square To see how the function works, here is an example. After the statement int c = getSumSquares (2, 4);...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT