# Multiplication of two objects of same class. Class should have an array of 10 intege

• 07-15-2010
SharJaan
Multiplication of two objects of same class. Class should have an array of 10 intege
Problem Statement: Multiplication of two objects of same class
• Write a class. Class should have an array of 10 integers as its private data member.
Class should have
• A default constructor which will initialize all array elements with zero.
• Getter and setter functions

1. Create three objects of the same class.
2. Must assign values to first and second objects through setter functions. You can either take input arrays from user or use hard coded values.
3. Display the values of first and second object through getter functions.
4. Multiply both objects and store the result of multiplication in third object.
5. Multiplication means the 1st element of member array of object1 should be multiplied by 1st element of member array of object2. Similarly, 2nd element should be multiplied with 2nd and so on. In the end, display the result stored in third object.
6. Your program should support the statement like a = b * c, where a, b and c are objects of the same class.

-------------------------------------------------------------------------
Sample output:
Object 1 :
1
2
3
4
5
6
7
8
9
10

Object 2 :
10
9
8
7
6
5
4
3
2
1

Multiplication of both objects :
10
18
24
28
30
30
28
24
18
10
• 07-15-2010
rogster001
Are you offering a job here? please have the good grace to actually write some kind of 'hello, i need help with...' at the very least, just posting your study paper is plain rude.
• 07-15-2010
iMalc
Ya know, thanks to all the posters like this we should have a pretty good list of beginner exercizes by now.
Hey someone's got to benefit from the fools who do nothing but post up their assignement description.
• 07-15-2010
jerimo
Since your just plain rude, I won't make any code for you, but since your asking for help that's what I'll do:

make 2 linear arrays of 10 "blocks" with each needed number in the right place. make the two first numbers multiply each other, do the same for the other numbers

This is the way I'd do it so you might have another idea