Use Lecture15 Code.c I template. The source code already has the fill_array () function which we reviewed in class. 1- Copy the other two functions into the program. Create appropriate function prototypes, documentation and definitions for those two functions. 2- Invoke all three functions inside the main function to test them. These are called driver programs, they test out user- defined functions. (You would need to declare a bunch of arrays in the main.) 3- Print the arrays and the results on to the screen. 4- Submit the source code through Canvas: YourName_Assignment7.c

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false. A double type is an example of a simple data type....
icon
Related questions
Question
/*
Lecture 14: Arrays aS Function Parameters
Date: 10/22/2021
Author: Sareh Taebi
*/
#include <stdio.h>
#define SIZE 50
// prototyping functions
void fill array(int list[], int n, int in_value);
int main()
{
int x [SIZE] = {0}; //computer needs to know about array type, number of
elements and its name (address of the array)
//call to a function that initializes all array
fill_array (x, 7, 777);
elements to 1
//print array elements
for (int i = 0; i< SIZE ; i++)
printf("%d\n", x[i]);
return 0;
//function definition comes after the main function
/*
fills any aray to an input value set by in_value parameter
Pre: array list, size of array, input value
*/
void fill_array(int list[], int n, int in_value)
{
int i;
for (i = 0; i< n ; i++)
iist [i]
in_value;
Transcribed Image Text:/* Lecture 14: Arrays aS Function Parameters Date: 10/22/2021 Author: Sareh Taebi */ #include <stdio.h> #define SIZE 50 // prototyping functions void fill array(int list[], int n, int in_value); int main() { int x [SIZE] = {0}; //computer needs to know about array type, number of elements and its name (address of the array) //call to a function that initializes all array fill_array (x, 7, 777); elements to 1 //print array elements for (int i = 0; i< SIZE ; i++) printf("%d\n", x[i]); return 0; //function definition comes after the main function /* fills any aray to an input value set by in_value parameter Pre: array list, size of array, input value */ void fill_array(int list[], int n, int in_value) { int i; for (i = 0; i< n ; i++) iist [i] in_value;
Use Lecture15 Code.c template. The source code already has the fill_array ( ) function which we reviewed in
class.
1- Copy the other two functions into the program. Create appropriate function prototypes, documentation and
definitions for those two functions.
2- Invoke all three functions inside the main function to test them. These are called driver programs, they test out user-
defined functions. (You would need to declare a bunch of arrays in the main.)
3- Print the arrays and the results on to the screen.
4- Submit the source code through Canvas: YourName_Assignment7.c
Transcribed Image Text:Use Lecture15 Code.c template. The source code already has the fill_array ( ) function which we reviewed in class. 1- Copy the other two functions into the program. Create appropriate function prototypes, documentation and definitions for those two functions. 2- Invoke all three functions inside the main function to test them. These are called driver programs, they test out user- defined functions. (You would need to declare a bunch of arrays in the main.) 3- Print the arrays and the results on to the screen. 4- Submit the source code through Canvas: YourName_Assignment7.c
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT