Define a class Addition which allows the user to add elements from one end (rear) and remove elements from the other end (front) only. The following details of the class Addition are given below: Class Name : Addition Data members/instance variables: St[ ] : an array to hold maximum of 100 integer elements cap : stores the capacity of the array. f : to point the index of the front. r : to point the index of the rear. Member functions/methods : Addition(int m) : constructor to initialize the data members cap =m, f=0, r=0 and to create the integer array. void pushFront(int v) : to add integers from rear index if possible else display the message “FULL”. int popValue( ) : to remove and return element from the front. If array is empty then return -9999. void display( ) : Displays the elements present in the list. (a) Specify the class Addition giving details of ONLY the constructor and member functions void pushFront(int v) and int popValue( ). Assume that the other functions are already defined. The main() function need not be written. [5] (b) What is the common name of the entity described above? On what principle does the above structure work. [2]
Answers
Answered by
0
Answer:
oxoydyodidlidigdogdoyd
Explanation:
gyisyidyodyodoydiydoydotstosots59a
Similar questions
Social Sciences,
3 months ago
Social Sciences,
3 months ago
English,
7 months ago
Math,
7 months ago
English,
11 months ago
Math,
11 months ago