please solve this problem and make the program

Problem Statement: Multiplication of two objects of same class
• You are required to 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
• An operator overloading function which will overload * operator for this class.

 You are required to create three objects of the same class.
 You must assign values to first and second objects through setter functions. You can either take input arrays from user or use hard coded values.
 Display the values of first and second object through getter functions.
 Multiply both objects and store the result of multiplication in third object.
 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.
 Your program should support the statement like a = b * c, where a, b and c are objects of the same class.
Awesome, is there any particular reason you're posting your task assignments on a public web forum?
This assignment is not that hard.. give it a try and you will make it i can give you a hint or two if you post some code :)

If someone else writes it how are you going to learn anything?
Okay, I solved the problem and made the program.
I'm thinking whether to provide a full solution the way I did some time ago
And how exactly would that be?
LOL, that was pretty cool! :P
I thought I'd be kind-hearted and provide a solution, just this once.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#include <algorithm>
#include <boost/array.hpp>
#include <exception>
#include <iostream>
#include <iterator>
#include <numeric>
#include <string>
#include <vector>

#define OOO0O001 else
#define O0O0O001 -
#define O1OlOl00 main
#define Ol010100 /
#define O10lO1O1 virtual
#define O10lOlO1 if
#define O1l00010 /=
#define O00O000l back_inserter
#define OOO0O00l unsigned
#define O0O0O0O1 exception
#define OO1lO10l [
#define O011010l break
#define O0l10101 continue
#define OO1l0101 fill_n
#define O01l01O1 for_each
#define Ol100010 long
#define O11O0010 char
#define O0OO0001 +
#define O000O001 ++
#define O0000O01 vector
#define O0l1O1O1 accumulate
#define O01l0l01 short
#define O0ll010l mutable
#define O1O10l0O do
#define O10lO101 ^=
#define O101O101 private
#define O101O1O1 protected
#define OllO001O return
#define O1lO0010 --
#define O1O10l00 while
#define Ol0lO1O0 array
#define l0ll01ll <<=
#define lO01ll11 ", "
#define lO01l111 " }"
#define l1l00O0l !
#define l110OO01 ^
#define l110OO0l float
#define O1OlO10O std
#define Ol01O101 ->
#define Ol01O1O1 &&
#define OlO10101 double
#define O10lO10O {
#define O1OlOl0O }
#define O11OOO10 string
#define O1100O1O typename
#define O1l0001O volatile
#define O1l0O1ll throw
#define O11001ll try
#define O110O1ll catch
#define O1100111 &
#define l100O011 -=
#define Oll010lO <
#define O11010lO <<
#define O1l010lO >
#define O11O10lO ;
#define l0O0O1ll &
#define l0O0O1l1 *
#define l0O001ll ?
#define O1lO10l0 public
#define O11010l0 operator
#define l0ll0l1l ]
#define l01lO01l .
#define l00l0Oll distance
#define l00lO0ll advance
#define l00111l1 "\na + b = { "
#define l0O11OOl new
#define lO01lO01 class
#define l0011001 struct
#define lOO0O1ll :
#define l00OO1ll ::
#define lOO0O11l (
#define lOOO01ll )
#define l0O0O11l copy
#define lOOl0O1l boost
#define l00l0O11 int
#define lOOlOO1l fill
#define l001l111 "a = { "
#define l001l1l1 "\nb = { "
#define l00l1001 !=
#define l0O1l11l explicit
#define l0O11l1l friend
#define l10OO01l +=
#define l10OOO1l delete
#define ll0OO01l >>
#define O110O111 ||
#define O110O1l1 |
#define Ol10011l /*
#define Ol100111 */
#define O11O10l0 for
#define OllOl0lO const
#define l0Oll001 union
#define l0Oll00l enum
#define l1O0O0l1 begin
#define l1O0OOl1 end
#define ll0000l1 *=
#define lOOll00l %
#define l0Ol1001 <=
#define lO01ll1l ""
#define l01l001l ,
#define lOl1001l =
#define l01l00l1 ==
#define l0llOl1l template
#define ll0O001l >>=
#define l1l0O0O1 Get
#define ll10O0Ol Set
#define l1l00O01 ~
#define lOO10O1l size_t
#define lOO1O01l size
#define l0Ol0O1l cout
#define l0110l1l >=
#define l1lOOO01 void
#define l1L000Ol static


lO01lO01 O0O1l10O O10lO10O lOOl0O1l l00OO1ll Ol0lO1O0 Oll010lO l00l0O11 l01l001l 00000010
O0OO0001 lOO0O11l 00000001 O11010lO 00000001 lOOO01ll O1l010lO Ol0lO1O0 O11O10lO O1lO10l0
lOO0O1ll O0O1l10O lOO0O11l lOOO01ll O10lO10O O1OlO10O l00OO1ll lOOlOO1l lOO0O11l Ol0lO1O0
l01lO01l l1O0O0l1 lOO0O11l lOOO01ll l01l001l Ol0lO1O0 l01lO01l l1O0OOl1 lOO0O11l lOOO01ll
l01l001l 00000000 lOOO01ll O11O10lO O1OlOl0O l00l0O11 l1l0O0O1 lOO0O11l lOO10O1l ll110O0O
lOOO01ll OllOl0lO O10lO10O OllO001O Ol0lO1O0 OO1lO10l ll110O0O l0ll0l1l O11O10lO O1OlOl0O
l00l0O11 ll10O0Ol lOO0O11l lOO10O1l ll110O0O l01l001l l00l0O11 lll10O0O lOOO01ll O10lO10O
OllO001O Ol0lO1O0 OO1lO10l ll110O0O l0ll0l1l lOl1001l lll10O0O O11O10lO O1OlOl0O O0O1l10O
O11010l0 l0O0O1l1 lOO0O11l OllOl0lO O0O1l10O l0O0O1ll OO01110O lOOO01ll OllOl0lO O10lO10O
O0O1l10O O0O11100 O11O10lO O11O10l0 lOO0O11l l00l0O11 lll10O0O lOl1001l 00000000 O11O10lO
lll10O0O Oll010lO 00000010 O0OO0001 lOO0O11l 00000001 O11010lO 00000001 lOOO01ll O11O10lO
O000O001 lll10O0O lOOO01ll O0O11100 l01lO01l ll10O0Ol lOO0O11l lll10O0O l01l001l l1l0O0O1
lOO0O11l lll10O0O lOOO01ll l0O0O1l1 OO01110O l01lO01l l1l0O0O1 lOO0O11l lll10O0O lOOO01ll
lOOO01ll O11O10lO OllO001O O0O11100 O11O10lO O1OlOl0O O1OlOl0O O11O10lO l00l0O11 O1OlOl00
lOO0O11l lOOO01ll O10lO10O lOOl0O1l l00OO1ll Ol0lO1O0 Oll010lO l00l0O11 l01l001l 00000010
O0OO0001 lOO0O11l 00000001 O11010lO 00000001 lOOO01ll O1l010lO l1l10O0O lOl1001l O10lO10O
00000001 l01l001l 00000010 l01l001l 00000011 l01l001l 00000100 l01l001l 00000101 l01l001l
00000110 l01l001l 00000111 l01l001l 00001000 l01l001l 00001001 l01l001l 00001010 O1OlOl0O
O11O10lO lOOl0O1l l00OO1ll Ol0lO1O0 Oll010lO l00l0O11 l01l001l 00000010 O0OO0001 lOO0O11l
00000001 O11010lO 00000001 lOOO01ll O1l010lO l1l10O0l lOl1001l O10lO10O 00000010 l01l001l
00000100 l01l001l 00000110 l01l001l 00001000 l01l001l 00000001 l01l001l 00000011 l01l001l
00000101 l01l001l 00000111 l01l001l 00001001 l01l001l 00001010 O1OlOl0O O11O10lO O0O1l10O
O0O1110O l01l001l OO01110O O11O10lO O11O10l0 lOO0O11l lOO10O1l lll10O0O lOl1001l 00000000
O11O10lO lll10O0O Oll010lO l1l10O0O l01lO01l lOO1O01l lOO0O11l lOOO01ll O11O10lO O000O001
lll10O0O lOOO01ll O0O1110O l01lO01l ll10O0Ol lOO0O11l lll10O0O l01l001l l1l10O0O OO1lO10l
lll10O0O l0ll0l1l lOOO01ll l01l001l OO01110O l01lO01l ll10O0Ol lOO0O11l lll10O0O l01l001l
l1l10O0l OO1lO10l lll10O0O l0ll0l1l lOOO01ll O11O10lO O11O10l0 lOO0O11l lOO10O1l lll10O0O
lOl1001l 00000000 O11O10lO lll10O0O Oll010lO l1l10O0l l01lO01l lOO1O01l lOO0O11l lOOO01ll
O11O10lO O000O001 lll10O0O lOOO01ll O1OlO10O l00OO1ll l0Ol0O1l O11010lO lOO0O11l lll10O0O
l0O001ll lO01ll1l lOO0O1ll l001l111 lOOO01ll O11010lO O0O1110O l01lO01l l1l0O0O1 lOO0O11l
lll10O0O lOOO01ll O11010lO lOO0O11l lll10O0O l01l00l1 l1l10O0l l01lO01l lOO1O01l lOO0O11l
lOOO01ll O0O0O001 00000001 l0O001ll lO01l111 lOO0O1ll lO01ll11 lOOO01ll O11O10lO O11O10l0
lOO0O11l lOO10O1l lll10O0O lOl1001l 00000000 O11O10lO lll10O0O Oll010lO l1l10O0l l01lO01l
lOO1O01l lOO0O11l lOOO01ll O11O10lO O000O001 lll10O0O lOOO01ll O1OlO10O l00OO1ll l0Ol0O1l
O11010lO lOO0O11l lll10O0O l0O001ll lO01ll1l lOO0O1ll l001l1l1 lOOO01ll O11010lO OO01110O
l01lO01l l1l0O0O1 lOO0O11l lll10O0O lOOO01ll O11010lO lOO0O11l lll10O0O l01l00l1 l1l10O0l
l01lO01l lOO1O01l lOO0O11l lOOO01ll O0O0O001 00000001 l0O001ll lO01l111 lOO0O1ll lO01ll11
lOOO01ll O11O10lO O0O1l10O O0O11100 lOl1001l O0O1110O l0O0O1l1 OO01110O O11O10lO O11O10l0
lOO0O11l lOO10O1l lll10O0O lOl1001l 00000000 O11O10lO lll10O0O Oll010lO l1l10O0l l01lO01l
lOO1O01l lOO0O11l lOOO01ll O11O10lO O000O001 lll10O0O lOOO01ll O1OlO10O l00OO1ll l0Ol0O1l
O11010lO lOO0O11l lll10O0O l0O001ll lO01ll1l lOO0O1ll l00111l1 lOOO01ll O11010lO O0O11100
l01lO01l l1l0O0O1 lOO0O11l lll10O0O lOOO01ll O11010lO lOO0O11l lll10O0O l01l00l1 l1l10O0l
l01lO01l lOO1O01l lOO0O11l lOOO01ll O0O0O001 00000001 l0O001ll lO01l111 lOO0O1ll lO01ll11
lOOO01ll O11O10lO O1OlOl0O

Aw... I really wanted to compile it and see if it works but I don't have boost (and probably neither the OP does). Would you mind editing it into a boost-free version???
g++ -E
lol ... perhaps later, because I didn't keep the original implementation. Or someone else could,
if they know the trick to de-obfuscation. (I wonder if OP does).

But it runs fine. Here is the output:


a = { 1, 8, 9, 64, 65, 72, 73, 512, 513, 520 }
b = { 8, 64, 72, 512, 1, 9, 65, 73, 513, 520 }
a + b = { 8, 512, 648, 32768, 65, 648, 4745, 37376, 263169, 270400 }


(I also have to wonder if OP can figure out how I got those numbers).
Topic archived. No new replies allowed.