Create the following class USING POINTERS/dereferences notation. class Array2_0 { private: int * arr; int size; public: Array2_0(int size);//constructor Populate(); //Populates the array by taking input from the user. PrintArray(); //prints all the values in array FindMax(); //Returns the max value in the array. FindMin(); //Returns the min value in the array. Find(int val); //Finds the val and returns true. Replace(int val, int val2); //Finds the first occurrence of val in the array and replaces it with val2. ReplaceAll(int val, int val2); //Finds all the occurrences of val in the array and replaces it with val2. }; Create an object of this class in main and call all functions.
Create the following class USING POINTERS/dereferences notation. class Array2_0 { private: int * arr; int size; public: Array2_0(int size);//constructor Populate(); //Populates the array by taking input from the user. PrintArray(); //prints all the values in array FindMax(); //Returns the max value in the array. FindMin(); //Returns the min value in the array. Find(int val); //Finds the val and returns true. Replace(int val, int val2); //Finds the first occurrence of val in the array and replaces it with val2. ReplaceAll(int val, int val2); //Finds all the occurrences of val in the array and replaces it with val2. }; Create an object of this class in main and call all functions.
Chapter7: Using Methods
Section: Chapter Questions
Problem 20RQ
Related questions
Question
Create the following class USING POINTERS/dereferences notation.
class Array2_0
{
private:
int * arr;
int size;
public:
Array2_0(int size);//constructor
Populate(); //Populates the array by taking input from the user.
PrintArray(); //prints all the values in array
FindMax(); //Returns the max value in the array.
FindMin(); //Returns the min value in the array.
Find(int val); //Finds the val and returns true.
Replace(int val, int val2); //Finds the first occurrence of val in the array and replaces it with val2.
ReplaceAll(int val, int val2); //Finds all the occurrences of val in the array and replaces it with val2.
};
Create an object of this class in main and call all functions.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,