Question: Need help on C++. Homework. hi this is the code from assignment 2 below can someone update it for the above assignment. The text highlighted
Need help on C++. Homework.

hi this is the code from assignment 2 below can someone update it for the above assignment. The text highlighted in blue is the only stuff to update.
#include using namespace std;
class Avg{ private: int size; float* Ok; public:
Avg(){ } Avg(int size){ this->size = size; Ok = new float[size]; }
void setSize(int size){ Avg in(size); this->size = size;
} int getSize(){ return size; }
void inputOk(){ for (int i = 0; i > Ok[i]; } }
float calSum(){ float tot = 0.0; for (int i = 0; i
return tot; }
float calAvg(){ return calSum() / size; }
void displayOk(){ cout
cout
} }; int main(){
int size;
cout > size;
Avg in(size);
in.inputOk(); in.displayOk(); float sum = in.calSum(); float avg = in.calAvg();
cout Assignment 3 (Repurpose Assignment 2l: Write a program that uses an array to find the Average of a set float values entered by the user. You will have the main function control the operation of the program, but all values will be stored in the class You will need to use get and set methods in your class. Create an array as a member of the class. Create a method that will generate 1000 random floats (between 1-100) No decimal valuables 1 method to sum all numbers in array Create 1 method to output the average of all numbers input by the user. Create 1 method to output all the numbers input by the user. Hard Code a Binary Search Method and allow the user to input a value to search for. Output if the value exist in the array. If the value exist in array output the location in the array. Attach Snipping photos of source code and output. Please show output of new method executing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
