Write a program that searches the array of up to 21 data


Problem  - Write a program that searches the array of up to 21 data values, in the range of 10 - 70 using a linear search. The array is filled with random numbers. A symbolic Constant should be used to establish the array size of 21. The "main" program will be used to print the heading and for declaration and to call user defined functions The main only calls functions and functions do all the work for this problem. Use

The UDF1 is called from the main and will ask the user for a seed value from (1-10) to generate up to 21 random numbers in the range of 10 - 70. The numbers are used to fill the array. No check is needed for the (1-10)

The UDF2 is called from the main and will print the array of 21 random numbers in the range of 10 - 70 to the screen (console) with 7 numbers to a line.

The UDF3 is called from the main and will ask the user for a search key. The search key will be used in that same function to look for and identify the position of the key value in the array.

This same function will print to a text file (data file), the value and the position or positions of the found value or print a message stating the value and that the values was not found. The rules for the output file: The data file must have the student's lastname_keyword included in the filename. The data file should have the extension .txt. The cprogram should print a "start to the data file with name and date".

The cprogram file must open the datafile with a statement. The cprogram should print an "end to the data file with name and date". The cprogram file must close the datafile with a statement. Please see the sample files.

Students will upload a filename.c file that has a copy of the console input and a copy of the text file output, and upload a text file that has a copy of the output. Students will print and turn in a filename.c file that has a copy of the console input and a copy of the text file output, and print and turn in a copy of the text file that has a copy of the output.

Students should follow the sample output by using the inputs given and provide sample output of 2 scenarios. Use 7 and use 10 for input. One scenario is for random data with the target found and the other scenario is for random data with the target not found.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program that searches the array of up to 21 data
Reference No:- TGS02897389

Expected delivery within 24 Hours