Lab #1 Solved

$24.99 $18.99

Requirements In this lab, you will cover pass by reference and error codes. You must analyze the problem given, determine what error conditions you must test for, and make sure you code will not crash if an error condition is encountered. Test code is provided that you may optionally use. 1.1 getAvg int getAvg (…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)
  • Requirements

In this lab, you will cover pass by reference and error codes. You must analyze the problem given, determine what error conditions you must test for, and make sure you code will not crash if an error condition is encountered.

Test code is provided that you may optionally use.

1.1 getAvg

int getAvg ( int size , int * array , double * result ) ;

i

Info: This function will take an integer array, an integer representing the size of the array, and a result pointer. This function will calculate the average of all the elements in the array, and place the result in the result pointer. The function must check that the size is at least 1, and that the array pointer is not NULL. The function will return -1 on error, or 0 on success.

Notice

!

Grading:

  1. Write required getAvg function * 5 points

!

Notice:

  1. All of your lab submissions must compile under GCC using the −W all and −W error flags to be considered for a grade.

  1. You are expected to provide proper documentation in every lab submission, in the form of code comments. For an example of proper lab documentation and a clear description of our expectations, see the lab policy document.

1

Lab #1 Solved
$24.99 $18.99