Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help to implement the missinvg function in this program. could you please help me to write ? #include #define LEN A 10 /*

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
I need help to implement the missinvg function in this program. could you please help me to write ?
#include #define LEN A 10 /* function declarations */ void print_array(int[], int); void reverse(int[], int); double average (int[], int); void insert(int[], int, int, int); int less_than_average(int[], int); void rotate_right(int[], int, int); void array_copy(int[], int[], int); void initialize(int[], int, int); void evens_on_left(int[], int); int find(int A[], int len, int x); int find_last(int A[], int len, int x); int contains_dup(int A[], int len); int main(int argc, char **argv) { int A[] = {9, 505, 321, 117, 27, 64, 13, 9, 12, 208}; int BILEN_A+1]; int newValue=505; printf("A[] is: "); print_array(A, LEN_A); initialize(B, LEN_A+1, 0); printf("B[] is: "); print_array(B, LEN_A+1); array_copy(B, A, LEN_A); printf("but now it's "); print_array(B, LEN_A+1); insert(B, newValue, 0, LEN A); printf("and after inserting %d at the beginning it's ", newvalue); print_array(B, LEN_A+1); printf("The average of A[] is xf ", average (A, LEN_A)); printf("There are %d items in All less than this. ", less_than_average(A, LENA)); reverse(A, LEN_A); print_array(A, LEN_A); rotate_right(A, LENA, 3); print_array(A, LENA); evens_on_left(A, LEN_A); print_array(A, LEN_A); printf("The index of the first occurrence of %d is %d. ", 9, find(A, LEN A, 9)); printf("The index of the last occurrence of %d is %d. ", 9, find_last(A, LENA, 9)); if (contains_dup (A, LEN_A)) printf("All contains a dup "); else printf("A[] doesn't contain a dup "); if (contains dup(B, LEN_A+1)) printf("B[] contains a dup "); else printf("BC) doesn't contain a dup "); return 0; > / functions implementation / * prints At inside parentheses with each value separated by commas to stdout (which will be the screen). / void print array(int Ai, int length) ( y returns the average of the items in A[] or 0.0 1r A is empty double average (int A[, int length) { 7. for now return 1.0 as a placeholder. We do this just so that the program compiles without warning until we've finished / return 1.0; returns the number of items in A that are less than the average of the items in A */ int less_than_average(int A[], int length) { for now return @ as a placeholder. We do this just so that the program compiles without warning until we've finished */ return 0; } /* Reverses the values in A[]. For example, if before the function, A[] contained (1,2,3,4,5], after the function, A[] contains [5,4,3,2,1] *7 void reverse(int A[], int length) { } /* returns the second largest item in A[], or -1 if len

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions