Objectives: Demonstrate the ability to create and use arrays. • Demonstrate the ability to search an array using a sequential search. • Demonstrate the ability to use sound programming practices. • Demonstrate the use of a function and pointers. Demonstrate the ability to use the Linux server. Problem Description: You are tasked with creating a program that will create an array of 100 random integers in the range of 1 to 200 (inclusive) once. Your array may contain duplicate values. Your program will then randomly generate a search target/value in the same range of 1 to 200 and perform a sequential search on the array of stored random values 100 times. Your program should print out the following statistics: The number of successful searches (a match was found). The number of failed searches. (no match was found in the array) The average number of tests (test comparisons) per search*. If a match is found at index 50 then 51 tests were done for that search. If no match was found then all 100 elements were tested. total comparisons/100 searches = average number of tests per search. During a search of the array each item will be tested if it is a match, you must keep count of how many tests are performed for each search to compute the average number of tests per search. Summary, your program should load an array with 100 numbers from 1 to 200 and then randomly generate a search term and search it 100 times (with 100 different search terms) while keeping track of statistics.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In C language please;

Requirements:

  • You must use the correct program and function descriptions. 
  • You must use a user defined function for the sequential search and it must use pointers to keep track of the number of successful searches as well as how many test comparisons were made.
  • You must use the srand() function and offset and range correctly. 
Objectives:
Demonstrate the ability to create and use arrays.
• Demonstrate the ability to search an array using a sequential search.
Demonstrate the ability to use sound programming practices.
• Demonstrate the use of a function and pointers.
Demonstrate the ability to use the Linux server.
Problem Description:
You are tasked with creating a program that will create an array of 100 random integers in the range of 1
to 200 (inclusive) once. Your array may contain duplicate values. Your program will then randomly
generate a search target/value in the same range of 1 to 200 and perform a sequential search on the
array of stored random values 100 times. Your program should print out the following statistics:
The number of successful searches (a match was found).
The number of failed searches. (no match was found in the array)
The average number of tests (test comparisons) per search*. If a match is found at index 50 then 51
tests were done for that search. If no match was found then all 100 elements were tested. total
comparisons / 100 searches = average number of tests per search.
During a search of the array each item will be tested if it is a match, you must keep count of how many
tests are performed for each search to compute the average number of tests per search.
Summary, your program should load an array with 100 numbers from 1 to 200 and then randomly
generate a search term and search it 100 times (with 100 different search terms) while keeping track of
statistics.
Transcribed Image Text:Objectives: Demonstrate the ability to create and use arrays. • Demonstrate the ability to search an array using a sequential search. Demonstrate the ability to use sound programming practices. • Demonstrate the use of a function and pointers. Demonstrate the ability to use the Linux server. Problem Description: You are tasked with creating a program that will create an array of 100 random integers in the range of 1 to 200 (inclusive) once. Your array may contain duplicate values. Your program will then randomly generate a search target/value in the same range of 1 to 200 and perform a sequential search on the array of stored random values 100 times. Your program should print out the following statistics: The number of successful searches (a match was found). The number of failed searches. (no match was found in the array) The average number of tests (test comparisons) per search*. If a match is found at index 50 then 51 tests were done for that search. If no match was found then all 100 elements were tested. total comparisons / 100 searches = average number of tests per search. During a search of the array each item will be tested if it is a match, you must keep count of how many tests are performed for each search to compute the average number of tests per search. Summary, your program should load an array with 100 numbers from 1 to 200 and then randomly generate a search term and search it 100 times (with 100 different search terms) while keeping track of statistics.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education