Polymorphic technique

1.     Write an object-oriented program in C++ using polymorphic technique that prints either the number and its square or the number and its cube from 0 to 100.

2.     Modify the above program so that it prints the number, square and cubes of only even numbers from 0 to 100 with the same output.

3.     Write a program in C++ to generate the following series of numbers using polymorphism.

(i) (ii)
1 1
2 1 1 2
3 2 1 1 2 3
4 3 2 1 1 2 3 4
5 4 3 2 1 1 2 3 4 5
6 5 4 3 2 1 1 2 3 4 5 6
7 6 5 4 3 2 1 1 2 3 4 5 6 7
8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8
9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9
(iii) (iv)
9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9
8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8
7 6 5 4 3 2 1 1 2 3 4 5 6 7
6 5 4 3 2 1 1 2 3 4 5 6
5 4 3 2 1 1 2 3 4 5
4 3 2 1 1 2 3 4
3 2 1 1 2 3
2 1 1 2
1 1
WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X