PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART) AND TASK 3.2 (SOURCE PROGRAM). THANK YOU!


Code:
#define SIZE 9 //declaring macro value
#include<stdio.h>
//declaring functions here
int compareAndCount(int[],int[]);
double averageDifference(int[],int[]);
//driver function
void main()
{
int a1[SIZE],a2[SIZE],count=0; //taking a1 for array A a2 for array B
double avg=0.0;
printf("Enter elements of array A:\n");
for(int i=0;i<SIZE;i++)
{
scanf("%d",&a1[i]);//inserting elements in array A
}
printf("Enter elements of array B:\n");
for(int i=0;i<SIZE;i++)
{
scanf("%d",&a2[i]);//inserting elements in array B
}
count = compareAndCount(a1,a2); //calling compareAndCount() function and passing a1 and a2
printf("Number of items in array A greater than the corresponding items in array B: %d",count);//printing count value
avg = averageDifference(a1,a2); //calling averageDifference() function and passing a1 and a2
printf("\nThe average difference between items in the array A and array B: %0.2lf",avg); //printing avg
}
//function defined here for compareAndCount()
int compareAndCount(int arr1[SIZE],int arr2[SIZE])
{
int count=0;
for(int i=0;i<SIZE;i++)
{
if(arr1[i]>arr2[i]) //condition to check element of arr1 is greater than arr2
{
count++; //if condition is true increment count value each time
}
}
return count; //returning value of count
}
//function defined here for averageDifference()
double averageDifference(int arr1[SIZE],int arr2[SIZE])
{
double average;
int sum=0;
int temp[SIZE];
for(int i=0;i<SIZE;i++)
{
temp[i] = arr1[i] - arr2[i];
printf("\narr1[%d] - arr2[%d]: %d",i,i,temp[i]); //subtrating each corresponding elements of both arrays and assigning it to temp array
}
for(int i=0;i<SIZE;i++)
{
sum = sum + temp[i]; //calculating summ of all the elements in the array
}
average = (double)sum/SIZE; //calculating average value of the elements in the array
return average; //returning the value of average
}
Output:

Flowchart:
According to the source code there will three flowchart for every function - main function , compareAndCount function, Averagedifference function.
Main function-
![Start int SIZE = 9 int a 1[SIZE],a2[SIZE] int count=0 double avg=0.0 inti print Enter elements of array A: i = 0 Loop i<SIZE](http://img.homeworklib.com/questions/bf37d630-0aa2-11eb-9364-e1db72e44a28.png?x-oss-process=image/resize,w_560)
compareAndCount function
![compareAndCount(int arr1[SIZE], int arr2[SIZE]) int count = 0 int i = 0 Loop i<SIZE arr1[i] > arr[2] count++ return count](http://img.homeworklib.com/questions/bf9eecc0-0aa2-11eb-8de4-1fc64718639e.png?x-oss-process=image/resize,w_560)
averageDifference function

PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART) AND TASK 3.2 (SOURCE PROGRAM). THANK YOU! Given...
PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART)
AND TASK 3.2 (SOURCE PROGRAM). THANK YOU!
Hint: the number array in task 2 is work for task 3 in
figure 1.
Given below is a partially completed C program, which you will use as a start to complete the given tasks. #define SIZE 9 #include <stdio.h> int compareAndCount (int[], int[]); double averageDifference (int[], int[]); void main() { } int compareAndCount(int arr1[SIZE], int arr2[SIZE]) { int count = 0; for (int i...
Given below is a partially completed C program, which you will use as a start to complete the given tasks. #define SIZE 9 #include <stdio.h> int compareAndCount (int[], int[]); double averageDifference (int[], int[]); void main() { } int compareAndCount(int arr1[SIZE], int arr2[SIZE]) { int count - @; for (int i = 0; i < SIZE; i++) { if (arri[i] > arr2[i]) count++; return count; Task 1: (10 pts) Show the design of the function compareAndCount() by writing a pseudocode. To...
I NEED HELP WITH THIS 2 PROBLEMS PLEASE! THANK YOU SO MUCH
Given below is a partially completed C program, which you will use as a start to complete the given tasks. #define SIZE 9 #include <stdio.h> int compareAndCount (int[], int[]); double averageDifference (int[], int[]); void main() { } int compareAndCount(int arr1[SIZE], int arr2[SIZE]) { int count = @; for (int i = 0; i < SIZE; i++) { if (arr1[1] > arr2[i]) count++; return count; } Task 1: (10...
I need this program converted to c++ Please help if you can import java.util.*; // Add two arrays of the same size (size) // Each array is a representation of a natural number // The returned array will have the size of (size + 1) elements public class Fibonacci { private static String arrToString(int[] arr) { String s = ""; for (int i = 0; i < arr.length; i++) { s = s + arr[i]; }...
COULD YOU PLEASE HELP ME************************** write a better mode computation function that uses the ideas in the word file and improves on the mode computation function in the cpp file. ===========source.cpp #include <ctime> #include <iomanip> #include <iostream> #include <string> #include <random> using namespace std; default_random_engine e(static_cast<unsigned>(time(NULL))); void fill(int a[], int size, int value) { for(int i = 0; i < size; i++) a[i] = value; } void randomFill(int a[], int size, int lb, int up) { uniform_int_distribution<int> u(lb, up); for(int...
Please help me finish my code. Before the final pause in the main function, create an ArrayList of another type such as double, char, short, bool, float, etc. Your choice. Add five data items to your array as we did for the int and string array lists. Print them out with a for loop as we did before. Print out the count and capacity of your new array list. Source.cpp #include #include #include #include "ArrayList.h" using namespace std; /// Entry...
Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays, and a random number generator. Upon program execution, the screen will be cleared and the menu shown below will appear at the top of the screen and centered. The menu items are explained below. Help Smallest Quit H or h ( for Help ) option will invoke a function named help() which will display a help screen. The help screen(s) should guide the user...
I need a c++ code please. 32. Program. Write a program that creates an integer constant called SIZE and initialize to the size of the array you will be creating. Use this constant throughout your functions you will implement for the next parts and your main program. Also, in your main program create an integer array called numbers and initialize it with the following values (Please see demo program below): 68, 100, 43, 58, 76, 72, 46, 55, 92, 94,...
Hi this is C++, I'm really struggle with it please help me.... ************************ Here is the original high score program,: Write a program that records high-score data for a fictitious game. The program will ask the user to enter five names, and five scores. It will store the data in memory, and print it back out sorted by score. The output from your program should look exactly like this: Enter the name for score #1: Suzy Enter the score for...