,

[SOLVED] Cs150 – lab 25

$25

File Name: Cs150_____lab_25.zip
File Size: 150.72 KB

Categories: , Tags: ,
5/5 - (1 vote)

Create an array of 10 integers containing the following values (in this order): 12, -7, 3, 17, 42, 6, 18, -15, 0, 1. Create a function called seqSearch that takes a const array and an integer key as parameters, and returns the array slot number that the key was found in. If the key was not found, the function should return -1. Main should use the function to have the user enter a number and print the array slot it was found in, or that it was not found.
Test Cases:
Test Case 1:
Enter a number to search for: <17> 17 was found in array slot 3.
Test Case 2:
Enter a number to search for: <12> 12 was found in array slot 0.
Test Case 3:
Enter a number to search for: <1> 1 was found in array slot 9.
Test Case 4:
Enter a number to search for: <40>
40 was not found.
****Note: Should NOT say 40 was found in array slot -1!****

Shopping Cart
[SOLVED] Cs150 – lab 25[SOLVED] Cs150 – lab 25
$25