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.



Program logic:
flow chart

function definiton:
double averageDifference(int arr1[SIZE], int arr2[SIZE]){
int sum = 0;
for(int i = 0; i<SIZE; i++){
sum += arr1[i]-arr2[i];
printf("arr1[%d] - arr2[%d]: %d\n", i,i,arr1[i]-arr2[i]);
}
return (double)(sum/SIZE);
}
program to call this function:
#define SIZE 9
#include <stdio.h>
int compareAndCount(int[], int[]);
double averageDifference(int[], int[]);
void main(){
int arr1[] = {111,2,333,44,55,16,27,83,99};
int arr2[] = {-11,22,13,88,99,101,34,25,-22};
double ave = averageDifference(arr1,arr2);
printf("The average difference between items in array A and array
B: %.2f\n", ave);
}
double averageDifference(int arr1[SIZE], int arr2[SIZE]){
int sum = 0;
for(int i = 0; i<SIZE; i++){
sum += arr1[i]-arr2[i];
printf("arr1[%d] - arr2[%d]: %d\n", i,i,arr1[i]-arr2[i]);
}
return (double)(sum/SIZE);
}
output:
![arr1[0] arr2[0]: 122 arr1[1] - arr2[1]: -20 arr1[2] - arr2[2]: 320 arr1[3] - arr2[3]: -44 arr1[4] - arr2[4]: -44 arr1[5] - ar](http://img.homeworklib.com/questions/2f8b3f00-08c2-11eb-9157-87ecbacdbf58.png?x-oss-process=image/resize,w_560)
PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART) AND TASK 3.2 (SOURCE PROGRAM). THANK YOU! Hint:...
PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART)
AND TASK 3.2 (SOURCE PROGRAM). THANK YOU!
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 = 0; i < SIZE; i++) { if (arri[i] > arr2[i]) count++; } return count;...
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...
Your goal is to create an ‘Array’ class that is able to hold
multiple integer values. The ‘Array’ class will be given
functionality through the use of various overloaded operators
You will be given the main() function for your program and must add
code in order to achieve the desired result. Do not change any code
in main(). If something is not working, you must change your own
code, not the code in main().
Assignment 5: overloading member functions. Overview:...
I NEED HELP WITH THE FLOWCHART AND PSEUDOCODES OF THIS PROGRAM
PLEASE!
+3) (5 pts) Show the screen output of running the following program. #include <stdio.h> Screen output: int f1(int, int); //function declaration void f2(int); int main() { printf("calling f1( ) ..\n"); int flResult = f1(7,-8); printf("flResult = %d\n", f1Result); }//main) int f1(int a, int b) { printf("in f1(): a = %d, b = %d\n", a, b); int data = -1; if (a >b) data = a - b: return...
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]; }...
Complete a program In C#: some code is included, you edit the areas that have not been filled. For your C# program you will complete code that plays the War card game. In this game, the deck of cards is evenly divided among two players. The players are not allowed to look at the cards in their hand. On each round of the game, both players lay down the top card from their hand. The player with the higher value...
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...
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,...