CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

12
Return to list New
Author: aku_EnSeM

C++ Programming

[Copy link]
Post time 11-10-2006 09:49 AM | Show all posts
preference sendiri laa.. heheeh
Reply

Use magic Report


ADVERTISEMENT


Post time 11-10-2006 10:31 AM | Show all posts

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]
Reply

Use magic Report

Post time 12-10-2006 09:48 PM | Show all posts
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!
Reply

Use magic Report

Post time 12-10-2006 11:29 PM | Show all posts
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..


  1. Time::Time(int hours, int minutes, int seconds)
  2. {
  3.         if (0 <= hours && hours < 24)
  4.                 hr = hours;
  5.         else
  6.                 hr = 0;

  7.         if (0 <= minutes && minutes < 60)
  8.                 min = minutes;
  9.         else
  10.                 min = 0;

  11.         if (0 <= seconds && seconds < 60)
  12.                 sec = seconds;
  13.         else
  14.                 sec = 0;
  15. }
Copy the Code
Reply

Use magic Report

Post time 13-10-2006 02:07 AM | Show all posts
owhhh!!ok ok ok..thanks!
Reply

Use magic Report

12
Return to list New
You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT


Forum Hot Topic

 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

28-12-2024 11:53 PM GMT+8 , Processed in 0.051477 second(s), 16 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list