Question
This repository cannot be compiled/executed directly after you clone it . It requires the changes explained in this file in order to make it compilable/executable.
This repository cannot be compiled/executed directly after you clone it. It requires the changes explained in this file in order to make it compilable/executable. This repository is supposed to:
(a) find the smallest element in char_array[1500][1200] -> var. name: minimum, and (b) calculate standard deviation from all the element in char_array[1500][1200] -> var. name: std_dev
char_array[1500][1200] is a 2D array from unsigned char data type and it should have an ASCII character in each of its element, loaded from the read_text() written in the main.hpp and called in the main() at line 19 (before your code).
For the standard deviation, std_dev, use the following formula:
Where,
: each element in the char_array
: average or mean of the char_array's elements
: total number of elements in char_array = 1,500 x 1,200 = 1,800,000
Your task is to write a void get_array_info() function, that pass the following parameters (in order):
(a) char_array array, (b) char_array's 1st dimension size, (c) minimum variable from 1)(a) above, and (d) std_dev variable from 1)(b) above
Do not change the line when the void get_array_info() is called (line 23) in main(). Write/change only the get_array_info() starting from line 37 (marked by //correct this function), as well as the function's definition in main.hpp file (marked by //correct this) at line 16 of the file.
Marks
There is a cout statement written for you to display the 2 results mentioned above on the terminal. The following explains your marks for each result:
(a) Smallest element in char_array (minimum var.): 3 marks (b) Standard deviation of the char_array (std_dev var.): 5 marks
You can either get 0, 3, 5 or 8 marks (full-marks).
Do not edit the other lines for any reason (e.g. to make it similar with your friend's question) since each of you will get a different set of question. In this case, you surely will get 0 mark. Do not cheat by simply assigning a pre-calculated value from the get_array_info(). If found, you will be awarded with 0 mark too!
Summary
To summarize, this program should be able to get the minimum and standard deviation of the char_array elements, from the void get_array_info() function. To achieve this, edit only at the following locations:\
(a) main.cpp - complete the get_array_info() itself from line 37 onwards (b) main.hpp - line 16 for the get_array_info() function declaration
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started