|
preference sendiri laa.. heheeh |
|
|
|
|
|
|
|
helllo semua....kago nak mintak tolog korang ni.......
ade tak sesape yang boleh tolong kago buat kan sesuatu....
k cam ni kago nak program kan kagonye litar........dalam microcontoller......ade tak sesape boleh tolong buat kan...kalau ade sile pm.kago atau ym [email protected] |
|
|
|
|
|
|
|
1.Create a class time that has separate it member data for hours, minutes and
seconds. One constructor should initialize this data to 0, and another should
initialize it to fixed values. Another member function should display it in
11:59:59 format. The final member function should add two objects of type time
passed as arguments.
A main( ) program should create two initialized time objects and one that isn抰
initialized. Then it should add the two initialized values together, leaving the
result in the third time variable. Finally it should display the value of this third
variable.
nak tanya,macam mana nak buat supaya yang dalam construct to dapat masok dalam member function?plisss pliss help me! |
|
|
|
|
|
|
|
Originally posted by adziah at 12-10-2006 09:48 PM
1.Create a class time that has separate it member data for hours, minutes and
seconds. One constructor should initialize this data to 0, and another should
initialize it to fixed values. Another ...
try aa buat duluu..hehehe
die dah bagi hint tuu.. constructor tuu.. die bukan nak default constructor tuu..
- Time::Time(int hours, int minutes, int seconds)
- {
- if (0 <= hours && hours < 24)
- hr = hours;
- else
- hr = 0;
- if (0 <= minutes && minutes < 60)
- min = minutes;
- else
- min = 0;
- if (0 <= seconds && seconds < 60)
- sec = seconds;
- else
- sec = 0;
- }
Copy the Code |
|
|
|
|
|
|
| |
|