Assignment H

Problem H1

Linear Search

Introduction and requirements:

Specify the array size as 5
Name an int array as: array
Declare a variable of type int, named result, which can be set to the offset where the target was found, or can be -1 if the target is not found
Declare a variable of type int, named target, which is set to the number we are looking for.

Ask the user for the target
Ask the user to: "enter the next value: " 5 times and save the values in the array.

Write a loop to find the result.
Print the result with an appropriate message.

Test twice:
First with target 5 and array values 1,3,3,6,7
Second with target 5 and array values 1,2,3,5,9

Problem H2

Write a program using a do..while loop to allow the user to input two doubles.
Print the two doubles.
If the first double is equal to the second double, repeat the loop, otherwise leave the loop.

Use two double variables named first and second.

Test it once with the following pairs of numbers:
3.1 and 3.1
5.7 and 5.7
7.2 and 7.8