Answer to Question #206088 in C++ for sanush

Question #206088

1.Write a function using C++ statements called AverageValue() which takes two integer values(value1,value2) and returns the average value as a float.


2.Write function using C++ statements called MaximumOutlet() which takes two integer values(value1,value2 )and returns the highest value.


3.Consider the following to answer the questions that follow.

RFC is one of the most popular food and grocery retailers. The company weekly record transaction details of a product over (four) 4 outlets.

The transaction code is a 4 – digit number and starts with 21. The last 2 digits indicate the quantity sold of the product.

Write a function using C++ statements called ProcessTransactions() which takes two 2 integer arrays (array 1,array2) and an integer as the size of the array 1.

Array 1 holds all transaction details while array2 holds the product quantity details after processing.

The function should use transaction details in array1 and store the quantity values in the array2.

Note: quantity is a 2-digit integer.


1
Expert's answer
2021-06-11T17:11:46-0400

1.Write a function using C++ statements called AverageValue() which takes two integer values(value1,value2) and returns the average value as a float.

# c++
float AverageValue(float value1, float value2)
{
  return 0.5 * (value1 + valie2);
}

2.Write function using C++ statements called MaximumOutlet() which takes two integer values(value1,value2 )and returns the highest value.

# c++
int MaximumOutlet(int value1, int value2)
{
  return value1 > value2 ? value1 : value2;
}

3.Consider the following to answer the questions that follow.

RFC is one of the most popular foods and grocery retailers. The company weekly record transaction details of a product over (four) 4 outlets.

The transaction code is a 4 – digit number and starts with 21. The last 2 digits indicate the quantity sold of the product.

Write a function using C++ statements called ProcessTransactions() which takes two 2 integer arrays (array 1,array2) and an integer as the size of the array 1.

Array 1 holds all transaction details while array2 holds the product quantity details after processing.

The function should use transaction details in array1 and store the quantity values in array2.

RFC is one of the most popular foods and grocery retailers. The company weekly record transaction details of a product over (four) 4 outlets.

The transaction code is a 4 – digit number and starts with 21. The last 2 digits indicate the quantity sold of the product.

Write a function using C++ statements called ProcessTransactions() which takes two 2 integer arrays (array 1,array2) and an integer as the size of the array 1.

Array 1 holds all transaction details while array2 holds the product quantity details after processing.

The function should use transaction details in array1 and store the quantity values in array2.

Note: quantity is a 2-digit integer.

void ProcessTransactions(int * array1, int * array2, int n)

{

  for (int i = 0; i < n; i++) 
    array2[i] = array1[i];
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog