Page 1 of 1

Description In this assignment I would like you write a few common pointer algorithms. You will need to write your own m

Posted: Fri Jul 08, 2022 6:40 am
by answerhappygod
Description In This Assignment I Would Like You Write A Few Common Pointer Algorithms You Will Need To Write Your Own M 1
Description In This Assignment I Would Like You Write A Few Common Pointer Algorithms You Will Need To Write Your Own M 1 (36.18 KiB) Viewed 57 times
Description In This Assignment I Would Like You Write A Few Common Pointer Algorithms You Will Need To Write Your Own M 2
Description In This Assignment I Would Like You Write A Few Common Pointer Algorithms You Will Need To Write Your Own M 2 (41.63 KiB) Viewed 57 times
Description In This Assignment I Would Like You Write A Few Common Pointer Algorithms You Will Need To Write Your Own M 3
Description In This Assignment I Would Like You Write A Few Common Pointer Algorithms You Will Need To Write Your Own M 3 (63.85 KiB) Viewed 57 times
Description In this assignment I would like you write a few common pointer algorithms. You will need to write your own main function that tests out these functions. Function 1: Returns a void • Named F1 • Takes in two pointers to integers • F1 swaps the value of the two integers Example: Start (main): a = 10 b = 20 End (main): a = 20 b = 10
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.