somebody can answer this problem?

closed account (LzC4jE8b)
construct a time class containing integer data members seconds,minutes,and hours.have the class contain two constructors:the first should be a default constructor having the prototype time(int,int,int),which uses a default values of 0 for each data member.the second constructor should accept a long integer representing a total number of seconds and disassemble the long integer into hours,minutes,and seconds.the final function member should display the class data members.
you think you can just post some homework and
expect us to do it?
why don't you just copy a classmate.

you've made no effort at all.
it is plain bad manners.
Here is a partial solution:
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
#include <iostream>
#include <cstring>
using namespace std;

#define o(x,y) lol##x##y=0,
#define O(x,y) lol##x##y=0
#define aaaaaa , 7, 5, 2, 0, 13, 12, 2, 0, 13,
#define o_o(x,y) lol##x##y,
#define v_v(x,y) lol##x##y
class lulztime
{
    private:
        #ifdef __cplusplus
        void ____ () const;
        #define aaaaa  {   'l'  , 'o', '\x70', 'r', 'e', 0141+2
        #define aaaa 5, 1, 2, 9, 4, 6, 7, 8, 3, 1
        void ____ ();
        typedef unsigned const int long __;
        #define omg ::lulztime ( __ o_o(int,1) __ o_o(int,2) __ v_v(int,3) )
        typedef char rofl;
        __ static ___ = sizeof ( __ );
        #define private prjvate
        rofl * _;
    public:
        lulztime ( __ o(int,1) __ o(int,2) __ O(int,3) );
        #define delete cout \
        << (rofl*)_+3*___<< \
        '\n'; delete
        ~lulztime();
        friend ostream
                             & operator
        << ( ostream         &
        ,    const lulztime  &_)
         { _.____(); return *&cout; }
         #define public bubljc
         #define aaa 'd', 32, 'g'-1, 0x69, 0x6D, '.', 115, '\165' }, b  [
         #define bb 12, 11, 5, 1, 10 }
};
#define wtf strncpy(

void lulztime::____ ()
{
    _ = new rofl [ 3* ___ + 033 ];
    rofl a [] = aaaaa , aaa ] = { aaaa, 10 aaaaaa bb;
    long O(l,ol);
    public:
        #endif
        _[3* ___+lollol] = a[__(b[lollol])];
        v_v(lo,l)++;
        if ( lollol > 24 )
            goto private;
        goto public;
    private:
        _[3* ___+lollol] = 0;

}

lulztime omg
#undef omg
{
    ____();
    wtf ( rofl* )
    _,  ( rofl* )
    &lolint1,___);
    wtf _+___,
    ( rofl* )
    &lolint2,___);
    wtf _+2*___,
    ( rofl* )
    &lolint3,___);
}

lulztime::~lulztime()
{
    delete[]_;
}

void lulztime::____ () const
{
    cout << *(__*)_ << ':' <<  *(__*)(_+___) << ':' << *(__*)(_+2*___) << '\n';
}




// test program:

int main()
{
    lulztime t ( 12, 34, 56 );
    cout << t;
}


I'm very well interested in the.. full... solution now.

Very... nice
It's only missing the second constructor...
Maybe I'll add it later

EDIT:

OK, here is the full answer:
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
#include <iostream>
#include <cstring>
using namespace std;

#define o(x,y) lol##x##y=0,
#define O(x,y) lol##x##y=0
#define aaaaaa , 7, 5, 2, 0, 13, 12, 2, 0, 13,
#define o_o(x,y) lol##x##y,
#define v_v(x,y) lol##x##y
class lulztime
{
    private:
        #ifdef __cplusplus
        void ____ () const;
        #define aaaaa  {   'l'  , 'o', '\x70', 'r', 'e', 0141+2
        #define aaaa 5, 1, 2, 9, 4, 6, 7, 8, 3, 1
        void ____ ();
        typedef unsigned int long __________;
        typedef unsigned const int __;
        #define omg ::lulztime ( __ o_o(int,1) __ o_o(int,2) __ v_v(int,3) )
        typedef char rofl;
        __ static ___ = sizeof ( __ );
        #define private prjvate
        __________ static asd;
        __________ qwe;
        rofl * _;
    public:
        lulztime ( __ o(int,1) __ o(int,2) __ O(int,3) );
        #define delete if ( ! \
        qwe ) cout \
        << (rofl*)_+3*___<< \
        '\n'; delete
        lulztime ( __________ );
        ~lulztime();
        friend ostream
                             & operator
        << ( ostream         &
        ,    const lulztime  &_)
         { _.____(); return *&cout; }
         #define public bubljc
         #define aaa 'd', 32, 'g'-1, 0x69, 0x6D, '.', 115, '\165' }, b  [
         #define bb 12, 11, 5, 1, 10 }
};
#define wtf strncpy(
lulztime::__________  lulztime::asd = 0;
void lulztime::____ ()
{
    _ = new rofl [ 3* ___ + 033 ];
    rofl a [] = aaaaa , aaa ] = { aaaa, 10 aaaaaa bb;
    long O(l,ol);
    public:
        #endif
        _[3* ___+lollol] = a[__(b[lollol])];
        v_v(lo,l)++;
        if ( lollol > 24 )
            goto private;
        goto public;
    private:
        _[3* ___+lollol] = 0;
    qwe = asd++;

}

lulztime omg
#undef omg
{
    ____();
    wtf ( rofl* )
    _,  ( rofl* )
    &lolint1,___);
    wtf _+___,
    ( rofl* )
    &lolint2,___);
    wtf _+2*___,
    ( rofl* )
    &lolint3,___);
}

lulztime::~lulztime()
{
    delete[]_;
}

void lulztime::____ () const
{
    cout << *(__*)_ << ':' <<  *(__*)(_+___) << ':' << *(__*)(_+2*___) << '\n';
}

lulztime::lulztime ( __________ v_v (1,2) )
{
    #undef o
    __ o = lol12 % 60;
    __ oo = lol12 / 60 / 60;
    __ ooo = lol12 / 60 + 60;
    __ oooo = lol12 / 60 * 60;
    __ ooooo = lol12 / 60 % 60;
    __ oooooo = lol12 / 60 - 60;
    lulztime ooooooo (oo,ooooo,o);
    *this = ooooooo;
    ooooooo._ = new char[100];
    ooooooo._[0] = oooooo - ooo + oooo;
}

int main()
{
    lulztime t1 ( 12, 34, 56 );
    lulztime t2 ( 12600UL );
    cout << t1 << t2;
}
Last edited on
closed account (LzC4jE8b)
Thanks a lot Bazzy...
@Bazzy
I really wonder, how have you written that kind of code ?
Have you used obfuscator ?
Nope, I wrote it myself.
It was quite hard for such a simple program but it was fun.
As long as you keep in mind what you want to get, you can easily write obfuscated code
The part I like the most is that it actually works as it should except from the 'copied from cplusplus.com' output

o_o and v_v are hilarious.
Thanks a lot Bazzy...


You don't think he actually...

... Nah.
Nice! Probably not the best thing to do...but it's certainly hilarious. Heh heh...
#include<iostream.h>
#include<conio.h>

class myclass
{
private:
int Data[10];
public:
myclass();
void Display();
void setData();
int getData();
myclass operator *(myclass);
};
myclass::myclass()
{
Data[0]=0;
Data[1],Data[2],Data[3],Data[4],Data[5],Data[6],Data[7],Data[8],Data[9],Data[10];

}
void myclass::Display()
{
// for (long int i=1; i<=10; i++)
//{
// cout<<Data[i]<<"\n";
//}
}
void myclass::setData()
{
for (long int i=1; i<=10; i++)
{
cout<<"";//"Enter "<<i+0<<" element:";
cin>>Data[i];
}
}
int myclass::getData()
{
for (long int i=1; i<=10; i++)
{
return Data[i];
}
}
myclass myclass::operator*(myclass ob2)
{
myclass abc;
for (long int i=1; i<=10; i++)
{
abc.Data[i]=i*ob2.Data[i];
}
return abc;
}
main()
{
myclass ob1,ob2,Multiply;

cout<<"Enter the values of object 1:\n\n";
ob1.setData();
cout<<"\n\nEnter the values of object 2:\n\n";
ob2.setData();
Multiply=ob1*ob2;
cout<<"\n\nMultiplication Of Both Object\n";
Multiply.Display();
getche();
}
in the above program when i multiply the object 1 to object 2 then all the answers from first value to 9 is correct but the 10 value result will become wrong
please if in the above program have mistak than correct it and tell me
ajmal1122, please start your own thread and post your code with neat formatting so that it is readable.
Topic archived. No new replies allowed.