Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to finish all 5 programs for my c for engineers class Using code blocks 1) PE 06 01 (Basic Arrays with Random Numbers)This

image text in transcribed
I need to finish all 5 programs for my c for engineers class
Using code blocks
1) PE 06 01 (Basic Arrays with Random Numbers)This program requires the creation and use of four specific functions (see end of problem). Write a program that loads two amays with random numbers using the rand() function. Each amay should contain exactly 15 integers. The amay elements should vary in value from -5to 5. For each amay, detenmine the following: smallest and largest value, and the number of oddand even elements in each amay. Your program should display each array to the screen followed by the smallest value, largest value, total oddelements, and total even elements. Create and use the functions maximum, mininum, totalodds, and totalEvens. for the srando function, then create a random amay with 10 integers that range from to 88. The program should display the original random array to the screen. Use the bubble sort routine discussed inclass to sort the array. The program should display the array, current pass number, and the total number of swaps made for each pass. Bonus (+5: Make this a sentinel controlled program. 99. Prompt the user to enter a valid integer search "key" between 50 99 and verify the user input. Use the linear search algorithm discussed in class to find the "key" value and array index location of the "key" value. If no value was found prompt the user to enter another number until a value is found. Display the random array to the screen only after the user finds a correct value for comparison. 4 PE 06 04 (Binary searching Arrays) Generate a random ning 15 integers from 10 to 25. Prompt the user to enter a valid integer key" between 10-25 and verify the user input. Use the binary search algorithm discussed in class to find the value and location of the "key" value. If no value was found prompt the user to enter another number until a value is found. Display the random array to the screen only after the user finds a correct value for 5) PE 06 05 (Two-by-Two Arrays) create a two-by-two array A using random integers from 1 to 10. Create a two-by-two array Busing random integers from -10 to 0. Combine the elements of A Busing a for loop to create amay C A +B. Display array A, B and Cto the screen for comparison. (Note that the sum of each element of A and B yields the corresponding element of C, c[e][e] a[e][e] b[e][ej, etc.) FRAME4 png MacBook Air

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

5. Who should facilitate the focus group?

Answered: 1 week ago