Design a class named Array with the data members capacity, size, and arr (a pointer that points to the first element of the array in the heap). Also design a member function named insert that adds elements to the end of the array, and a function named print that prints the element of the array. Test your program with two arrays: Array 1 that returns three elements and Array 2 that returns 20 elements with an increment of 10 between each element. Include a header file, an implementation file for the Array class, and the application file to test the Array class.
Design a class named Array with the data members capacity, size, and arr (a pointer that points to the first element of the array in the heap). Also design a member function named insert that adds elements to the end of the array, and a function named print that prints the element of the array. Test your program with two arrays: Array 1 that returns three elements and Array 2 that returns 20 elements with an increment of 10 between each element. Include a header file, an implementation file for the Array class, and the application file to test the Array class.
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 20RQ
Related questions
Question
Design a class named Array with the data members capacity, size, and arr (a pointer that points to the first element of the array in the heap). Also design a member function named insert that adds elements to the end of the array, and a function named print that prints the element of the array. Test your program with two arrays: Array 1 that returns three elements and Array 2 that returns 20 elements with an increment of 10 between each element. Include a header file, an implementation file for the Array class, and the application file to test the Array class.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
How do you separate this code into a header file, implementation file, and the application file?
Solution
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
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT