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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false. A double type is an example of a simple data type....
icon
Related questions
Question

Design a class named Array with the data members capacitysize, 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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
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
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Arrays
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning