Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in c bring 2019 Loncepts to Practice Arrays Passing arrays to functions Symbolic constants Expand the prelab Submission Information Submit this assignment by following

Code in c image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
bring 2019 Loncepts to Practice Arrays Passing arrays to functions Symbolic constants Expand the prelab Submission Information Submit this assignment by following the instructions given by your TA SUBMIT ONLY the or executable file is required). Use the following submit command. c file (no a out submit cclass> cassignment> cfilename> e.g.: submit C$1050 Lab S c-labs.c Filename must be: sectionletter-labS.c (Use your lab section for section-letter) e.g. c-labS.c Description For the lab assignment, you need to define a symbolic constant called LIMIT that will be You should declare two arrays, both of type int in your that you must use the symbolic constant in your declaration of each array, as well as every need to reference the number of elements in each array). Initialize the first array so that the value of equal to 10. main() function that have LIMIT elements (note each element is equal to that element's subscript times itself. For example: firstarray[3] 9 (because 9 3 3) Initialize the second array so that the value of each element is equal to that element's subscript. For example: secondarray[3] 3 You will write a function to do each type of initialization, as described below nce your arrays are initialized, you should pass them each to PrintArray/D, and then pass them together oeach of the functions SumArrays() and MultArrays). These three functions are described below. sample Output JirnR@limRAreaS1: /CS JimR@JimRAreas1 a51-ICS1050/sp201 as1-Is10so/sP2019/Labs and Homework/Lab5s Ja.out 19/Labs and Homework/Lab5s compilexlabs Array 1: 49 81 Array 2: Sum of elements of arrays: 12 42 Product of elements of arrays: 27 125 343 512 729 Functions You Must Write You may write any functions you wish to implement this program, in addition to the following functi However, you must implement the following functions: void InitArraySquarelint arrayl, int size) -This function takes an array that has size element The value of each element in the array is set to the value of its subscript squared. void InitArrayLine The value of each element in the array is set to the value of its subscript. arlint arrayll, int size)- This function takes an array that has size elements void PrintArraylint arrayl, int size) -This function takes an array that has size elements. The value of each element in the array is printed tion takes two arrays that e void SumArrays(int array1l1, int array2l, int size) - This func The value of the sum of the corresponding element in the arrays is ach printed have size elements. void MultArrays(int array1ll, int array21, int size)-This functio have size elements. The value of the product of the corresponding element in the arr printed. n takes two arrays that each int main(void)-Of course, you need to write a mainl) . Guidelines for Grading Lab 5 40 Points Possible (+5 bonus points) General If your program does not compile, or produce any input/output /O) because most of the code is commented out then your source credit your C program specifications. lab will receive a grade of NO POINTS. For partial must not only compile but also produce some valid V'O that meets the lab 5 points: Header and general coding style. 5 points: InitArraySquare0 function 5 points: Output matches the sample output correctly. 5 points: InitArrayLinearO function. 5 points: PrintArray0 function. 5 points: SumArrays0 function. 5 points: MultArrays0 function. 5 points: main0 function. BONUS (5 points) Write a new function called InitArrayPower elements. The value of each element in the array is set to the value of its subscript raised to the power specified. void InitArrayPower(int arrayll, int size, int power)-This function takes an array that has size Change your InitArraySquarel) and InitArraylinearl) functions to call IitArrayPowerl) instead

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

Know how to use reservations systems to inventory demand.

Answered: 1 week ago

Question

Be familiar with the integrative servicescape model.

Answered: 1 week ago