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
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
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
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;](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F04c52921-cfa4-41e1-9a17-e97aadee2312%2F9eef513e-a310-4daf-8db8-57059c6e65d5%2Ffbs4hkq5_processed.png&w=3840&q=75)
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;

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education