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

Assignment Help C/C++ Programming
Reference no: EM132103934

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 <stdio.h>

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.

Reference no: EM132103934

Questions Cloud

Declare a struct tokenfreq that consists of two data members : You are required to use an integer vector to store the input numbers typed from the keyboard. The declaration of this vector will be in main().
New reduced heat liberation process : Show the calculations of heat (q) in support of your suggestion for a new monosaccharide to use in this new reduced heat liberation process.
What is a strong acid : What is a Strong acid? how is a strong acid is different than a concentrated acid?
How do svante arrhenius : How do Svante Arrhenius, Johannes Nicolaus Brønsted and Thomas Martin, and G.N. Lewis each define acids and bases?
Write a program that searches the array of up to 21 values : 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.
How do you convert from liters to fluid liters : How do you convert from liters to fluid liters? For example, how would you determine that 3.3x10^-14L = 33fL?
What system of linear equations should be used to solve : With this problem what system of linear equations should be used to solve for with this function we create?
Outline the steps needed to solve the problem : Outline the steps needed to solve the following problem, then do the calculations. Ether, , which was originally used as an anesthetic
Draw arrows in the cells to store traceback information : Draw arrows in the cells to store traceback information. What is the score of the optimal global alignment and what alignment(s) achieves this score?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create a program that allows a user to view the voltage

CSE1PES: PROGRAMMING FOR ENGINEERS AND SCIENTISTS - create a program that allows a user to view the voltage, current and impedance

  Write a function that takes a double array name

Write a function that takes a double array name and an array size as arguments and returns the largest value in that array.

  Set up a user terminated loop

Write a program in c language that finds a maximum of three numbers. Input consists of the three numbers. Output should list the three numbers and display the largest of the three.

  How do you open the binary file

Give a statement that will close the stream output This Way created as the answer to Self-Test Exercise.

  Write a main function to test the class employee

Define an Employee class. Add the following private date members to the class: string status, int dependents. Status represents the marital status of the employee and should be set to either "m" or "s".

  Enter the temperature at noon of each of the five days

Write a program that allows each employee to enter the temperature at noon of each of the five days and displays the highest, lowest, and average (mean) temps.

  Creates an array of structure and then fills array with data

Assignment: Exploring Data Representation- The program creates an array of structures and then fills the array with data entered by the user.

  Write a program using one while loop

Write a program using one while loop that will read in a sequence of integers guaranteed to be within the inclusive range of 0 through 99,999 from the user

  Write a c program to enter the numbers until the user wants

Write a C program to enter the numbers until the user wants and in the end display the product of numbers entered by the user.

  Calculate the total for each student

Calculate the total for each student - calculate the average for each of the assessments

  Difference between a constant pointer

Explain the difference between a constant pointer to non-constant data and a non-constant pointer to constant data. Show the syntax to declare them.

  Five elements similar to having different variables

How is an array with five elements similar to having five different variables?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd