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.
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....
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
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
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
by Bartleby Expert
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
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning