I need implementation of this problem using ADT List. It should have at least 3 modules( classes). Help me please! A math teacher needs a program in order to help students to test different properties of numbers. The
program manages a list of numbers and also allows students to repeatedly execute the following
functionalities (each functionality is exemplified):
1. Add numbers into the list.
a. add 123 – adds 123 at the end of the list
b. insert 123 at 1 – insert number 123 at position 1 in the list; positions are numbered from 0.
2. Modify elements from the list.
a. remove 1 – removes the element at position 1.
b. remove from 1 to 3 – removes the elements at positions 1,2, and 3.
c. replace 1 3 5 with 5 3 – replaces all the occurrences of sublist 1 3 5 with the sublist 5 3.
3. Write the numbers having different properties.
a. prime from 1 to 5 – writes the prime numbers between position 1 and 5 in the list.
b. odd from 1 to 5 – writes the odd numbers between position 1 and 5 in the list.
4. Obtain different characteristics of sublists.
a. sum from 1 to 5 – writes the sum numbers between position 1 and 5 in the list.
b. gcd from 1 to 5 - writes the greatest common divisor of elements between position 1 and
5 in the list.
c. max from 1 to 5 – writes the greater element of the sublist from position 1 to 5.
5. Filter.
a. filter prime – retains only the prime numbers.
b. filter negative –retains only the negative numbers.
6. Undo the last operation.
a. undo – the last operation that has modified the list of numbers is cancelled.

Recommended Answers

All 3 Replies

Unfortunately we do not do homeworks, but we do help if you get stuck and post your code and debugging efforts.

is not a homework, i just want to learn the concept. I`m not at school, I try to learn C++ on my own.

It still makes you learn if we give things freely, so please show what you can do and we can carry on from there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.