Description In this assignment I would like you write a few common pointer algorithms. You will need to write your own m
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Description In this assignment I would like you write a few common pointer algorithms. You will need to write your own m
Function 2: • Returns an integer • Named F2 • Takes in an integer array, and integer representing the size of the array. • Iterate through the array and if any value is less than 10, set it to 10, if any values are greater than 20, set it to 20. • Return how many changes you had to do. Example: Start arr [3, 5, 10, 15, 35, 17, 2] = size = 7 End: arr [10, 10, 10, 15, 20, 17, 10] size = 7 Function return 4
Rubric • 1 point - Comment with name, class, assignment name, and date 2 points Code neatness • 1 point - Function 1 has correct return type • 1 point Function 1 has correct parameters • 2 points - Function 1 completes task • 1 point - Function 2 has correct return type • 1 point - Function 2 has correct parameters • 1 point - Function 2 iterates through an array (think for loop) • 2 point - Function 2 changes detects if a value is less than 10 or greater than 20. 2 point Function 2 in the context of a loop it changes the array's value to 10 or 20 - • 1 point Function 2 has a counting variable for how many changes are made. • 2 points - Function 2 returns the correct value.