Question

A void function named getInventory is passed four int variables named beginInv, sales, purchases, and endInv....

A void function named getInventory is passed four int variables named beginInv, sales, purchases, and endInv. The function’s task is to calculate the ending inventory, using the beginning inventory, sales, and purchase amounts passed to the function. The function should store the result in the endInv variable. Which of the following function headers is correct?

a. void getInventory(int b, int s, int p, int &e)

b. void getInventory(int b, int s, int p, int e)

c. void getInventory(int &b, int &s, int &p, int e)

d. void getInventory(&int b, &int s, &int p, &int e)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer)
b. void getInventory(int b, int s, int p, int e)
is the correct option.

The variables b, s, p and e will represent the values which will be passed into the function getInventory which are variables beginInv, sales, purchases, and endInv respectively. The above function header is thus correct in this regard.

Add a comment
Know the answer?
Add Answer to:
A void function named getInventory is passed four int variables named beginInv, sales, purchases, and endInv....
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 void function named getInventory is passed four int variables named beginInv, sales, purchases, and endInv....

    A void function named getInventory is passed four int variables named beginInv, sales, purchases, and endInv. The function’s task is to calculate the ending inventory, using the beginning inventory, sales, and purchase amounts passed to the function. The function should store the result in the endInv variable. Which of the following function headers is correct? a. void getInventory(int b, int s, int p, int &e) b. void getInventory(int b, int s, int p, int e) c. void getInventory(int &b, int...

  • 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...

  • Problem H1 (Using C++) In the main function, define four variables of type int, named: first,...

    Problem H1 (Using C++) In the main function, define four variables of type int, named: first, second, third, and total. Write a function named getData that asks the user to input three integers and stores them in the variables first, second, and third which are in the main function. Write a function named computeTotal that computes and returns the total of three integers. Write a function named printAll that prints all the values in the format shown in the following...

  • What I need: Create a new program named Reverse4 and declare four integer variables with the...

    What I need: Create a new program named Reverse4 and declare four integer variables with the values 23, 45, 55, and 67. Add a method named Reverse that reverses the positions of four integer variables. The Reverse method should accept the variables as references. Write a Main() method that displays the four variables both before and after reversing them to ensure the method works correctly. What I have: using System; class Reverse4 { public static void reverse(ref int num1, ref...

  • 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)...

  • Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double...

    Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double number-25.0: int main) f int x-18, y-20; cout<c"Before: x- kex<" and y-eyecendl; Fundxy 1// end of main void Funcfint a, int b) int sum a+b; a-200; b-300; numberanumber+1.0 Which of the statements below are correct? (Select only the correct answers. There may be more than one) D A The statement double number-25.0; declares a global variable number B. The variables x and y are...

  • Warnerwoods Company uses a perpetual inventory system. It entered into the following purchases and sales transactions for March

     Warnerwoods Company uses a perpetual inventory system. It entered into the following purchases and sales transactions for March. (For specific identification, the March 9 sale consisted of 80 units from beginning inventory and 340 units from the March 5 purchase; the March 29 sale consisted of 40 units from the March 18 purchase and 120 units from the March 25 purchase.) Required 1. Compute cost of goods available for sale and the number of units available for sale. 2. Compute the number of...

  • Laker Company reported the following January purchases and sales data for its only product. Date Activities...

    Laker Company reported the following January purchases and sales data for its only product. Date Activities Units Acquired at Cost Exercise 6-3 Perpetual: Inventory costing methods P1 Units Sold at Retail 140 units @ $6.00 = $ 840 100 units @ $15 Jan. 1 Jan. 10 Jan. 20 Jan. 25 Jan. 30 Beginning inventory ... Sales... Purchase .. Sales..... Purchase .. Totals 60 units @ $5.00 = 300 80 units @ $15 180 units @ $4.50 = 810 380 units...

  • (Packing Characters into an Integer) The left-shift operator can be used to pack four character values into a four-byt...

    (Packing Characters into an Integer) The left-shift operator can be used to pack four character values into a four-byte unsigned int variable. Write a program that inputs four characters from the keyboard and passes them to function packCharacters. To pack four characters into an unsigned int variable, assign the first character to the unsigned intvariable, shift the unsigned int variable left by 8 bit positions and combine the unsigned variable with the second character using the bitwise inclusive OR operator....

  • write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy....

    write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy. The function should be passed 2 parameters, as illustrated in the prototype below. int pow_xy(int *xptr, int y); Assuming that xptr contains the address of variable x, pow_xy should compute x to the y power, and store the result as the new value of x. The function should also return the result. Do not use the built-in C function pow. For the remaining problems,...

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