eLi_chan
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 4
|
 |
« on: October 12, 2009, 06:53:07 PM » |
|
newbie in C..freshman student lang pu..binigayn kaxe kami nan prof namin nan proj..ee di nmn nya tinuro kung panu talaga gagawin un..intindihin na lang daw namn..(( ang makagawa daw samin exempted sa finals..wooh..help puh..)
-------------------------------------------------------------- Worksheet 10 (looping statement)
Write a program that will display a clock enclosed in a double box that starts from 00:00:00 (HH:MM:SS) at the center of the monitor. The counting will start from seconds and when it reached 60 sec. automatically the minute will increment by 1 and then the second again back to .When the minute reaches 60,automatically the hour will increment by 1 and then the minute again back to 0 and then so on....until it reaches 12:00:00, the program will be terminated.
output requirement:
____________________________________________________________
Time will stop at 12:00:00
________________________________________ / / / HH : MM : SS / / 00 : 00 : 00 / / / _________________________________________
Press a key to stop temporarily
_____________________________________________________________
yan pu un output... help lang pu... pag.aralan q dn nmn pu ee.. pls:(
|
|
|
|
|
Logged
|
“The question of whether computers can think is like the question of whether submarines can swim.”
|
|
|
|
The Philippine Electronics and Technology Forum
|
 |
« on: October 12, 2009, 06:53:07 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
ptolemy
Size AAA Battery
 
Pogi/Ganda Points: 2
Offline
Posts: 76
|
 |
« Reply #1 on: October 12, 2009, 07:56:34 PM » |
|
try mo aralin yung time.h ng C.. simple lang yan
|
|
|
|
|
Logged
|
|
|
|
ptolemy
Size AAA Battery
 
Pogi/Ganda Points: 2
Offline
Posts: 76
|
 |
« Reply #2 on: October 12, 2009, 07:59:00 PM » |
|
yung logic na naiisip ko diyan may counter ka para sa hours mins at seconds tapos kada tick ng system clock mo magiincrement yan clock mo
|
|
|
|
|
Logged
|
|
|
|
eLi_chan
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 4
|
 |
« Reply #3 on: October 12, 2009, 08:07:18 PM » |
|
sir ptolemy->ee un nga..kaxe nmn...stdio lang pati conio lan tinuro samin tapos nagbibigay nan ganyan kahirap..haha..geh puh..ssearch q un^^v..mamatz puh..eh panu un..parang hirap talga..di q magetz.. 
|
|
|
|
|
Logged
|
“The question of whether computers can think is like the question of whether submarines can swim.”
|
|
|
eLi_chan
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 4
|
 |
« Reply #4 on: October 12, 2009, 08:12:43 PM » |
|
waaaa....an hirap talaga:(( help..help..help.T_T
|
|
|
|
|
Logged
|
“The question of whether computers can think is like the question of whether submarines can swim.”
|
|
|
ptolemy
Size AAA Battery
 
Pogi/Ganda Points: 2
Offline
Posts: 76
|
 |
« Reply #5 on: October 12, 2009, 08:32:43 PM » |
|
basta try niyo pa i google... sa tingin ko po imposible na magawa without using any other libraries
|
|
|
|
|
Logged
|
|
|
|
eLi_chan
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 4
|
 |
« Reply #6 on: October 13, 2009, 06:07:38 AM » |
|
kaya nga po ee..napaka.complicated....conio and stdio lang dpat gamitin..  (
|
|
|
|
|
Logged
|
“The question of whether computers can think is like the question of whether submarines can swim.”
|
|
|
Viral
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 5
|
 |
« Reply #7 on: March 03, 2010, 04:18:53 PM » |
|
/*try nyu 2 make sure walang typing error*/
#include<stdio.h>
main() int hour,min,sec,ms; { clrscr();
printf("My Clock"); for (hour = 1 ; hour =>12;++hour) { for (min = 0 ; min =>59;++min) { for (sec = 0 ; sec =>59;++sec) { for (ms = 0 ; ms =>59;++ms) { clrscr(); printf("HOUR/MINUTE/SECONDS/MILISECOND"); delay(6.3); } } } } getch(); return 0; }
|
|
|
|
|
Logged
|
|
|
|
mini_mouse ^_^
Size C Battery
   
Pogi/Ganda Points: 4
Offline
Gender: 
Posts: 186
...All is Well...
|
 |
« Reply #8 on: March 03, 2010, 05:40:37 PM » |
|
#include<stdio.h> #include<conio.h>
main(){
int hh, mm, sec;
for(hh=0;h<=12;hh++) {
for(mm=0;min<=60;min++) {
for(sec=0;sec<=60;sec++) { clrscr(); printf("%d:%d:%d", hh, min, sec) delay(60); }
} }
getche(); return 0; }
just try lang.. and manipulate the code...
|
|
|
|
|
Logged
|
...I'm thankful each and every day, coz I found you...
|
|
|
Viral
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 5
|
 |
« Reply #9 on: March 06, 2010, 04:32:29 PM » |
|
nice one kulang code ko mali rin yung condition ko ^^
|
|
|
|
|
Logged
|
|
|
|
mini_mouse ^_^
Size C Battery
   
Pogi/Ganda Points: 4
Offline
Gender: 
Posts: 186
...All is Well...
|
 |
« Reply #10 on: March 07, 2010, 08:43:41 AM » |
|
...post your code para ma-edit... wala kasi akong dev-c ngayon... try ko pa mg-dl ulit...
|
|
|
|
|
Logged
|
...I'm thankful each and every day, coz I found you...
|
|
|
ultrasonic™
Solar Power Satellite
   
Pogi/Ganda Points: 774
Offline
Gender: 
Posts: 6156
never be harsh coz everythng is fine
|
 |
« Reply #11 on: March 07, 2010, 02:29:13 PM » |
|
subscribing para marefresh ang utak
|
|
|
|
|
Logged
|
im always walking on the rain so that no one could see me crying
|
|
|
zeitcheist
Size AA Battery
  
Pogi/Ganda Points: 2
Offline
Gender: 
Posts: 114
|
 |
« Reply #12 on: March 07, 2010, 10:56:02 PM » |
|
Kamo ang sabi ng instructor mo eh stdio.h lang at saka conio.h ang pwede gamitin? Tapos dapat ba accurate ung seconds elapsed? Kasi kung dapat accurate, you must use delay function, na nasa dos.h.. Pero kung hindi naman, pwede ka gumawa ng sarili mong delay function.. Kung accurate, without using dos.h, i suggest basahin mu ung dos.c, para malaman mo ung implementation ng delay().
|
|
|
|
|
Logged
|
There are only 10 types of people in the world; those who understand binary, and those who don't.
|
|
|
Viral
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 5
|
 |
« Reply #13 on: March 10, 2010, 09:13:42 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
Viral
LR44 Battery
Pogi/Ganda Points: 0
Offline
Posts: 5
|
 |
« Reply #14 on: March 10, 2010, 11:07:30 PM » |
|
atsaka pa help sana ako kung sino nakakaalam
paki read na lang convert ko lang yung text sa binary code!... Thanks
01110000 01101100 01100101 01100001 01110011 01100101 00100000 01101000 01100101 01101100 01110000 00100000 01101101 01100101 00100000 01101011 01110101 01101110 01100111 00100000 01110000 01100001 01100001 01101110 01101111 00100000 01101001 00100000 01100011 01110010 01100001 01101011 01111001 01110101 01101110 01100111 00100000 01110101 01101110 01110010 01100101 01100111 01101001 01110011 01110100 01100101 01110010 00100000 01101110 01100001 00100000 01110011 01101111 01100110 01110100 01110111 01100001 01110010 01100101 00100000 01110011 01100001 01101110 01100001 00100000 01101101 01100001 01110100 01110101 01101100 01110101 01101110 01100111 01100001 01101110 00100000 01101110 01111001 01110101 00100000 01100001 01101011 01101111 00100001 00100000 01100001 01110100 01110011 01100001 01101011 01100001 00100000 01110000 01100001 00100000 01110011 01101000 01100001 01110010 01100101 00100000 01101110 01100001 00100000 01110010 01101001 01101110 00100000 01110011 01100001 00100000 01101110 01100001 01101100 01100001 01101100 01100001 01101101 01100001 01101110 00100000 01101110 01111001 01110101 00100000 01110011 01100001 00100000 01100001 01110011 01110011 01100101 01101101 01100010 01101100 01111001 00100000 01101100 01100001 01101110 01100111 01110101 01100001 01100111 01100101
|
|
|
|
|
Logged
|
|
|
|
mini_mouse ^_^
Size C Battery
   
Pogi/Ganda Points: 4
Offline
Gender: 
Posts: 186
...All is Well...
|
 |
« Reply #15 on: March 11, 2010, 10:34:11 AM » |
|
...sa delay function: void delay(int duration){ for(int i=0; i<=duration; i++){ for(int j=0; j<=10800; j++){ } } } sa main function call mo, db you called delay(); instead of dalay(60), make it delay(21600); #include<stdio.h> #include<conio.h>
main(){
int hh, mm, sec;
for(hh=0;h<=12;hh++) {
for(mm=0;min<=60;min++) {
for(sec=0;sec<=60;sec++) { clrscr(); printf("%d:%d:%d", hh, min, sec) delay(60); }
} }
getche(); return 0; }
just try lang.. and manipulate the code...
|
|
|
|
|
Logged
|
...I'm thankful each and every day, coz I found you...
|
|
|
zeitcheist
Size AA Battery
  
Pogi/Ganda Points: 2
Offline
Gender: 
Posts: 114
|
 |
« Reply #16 on: March 11, 2010, 10:49:50 PM » |
|
...sa delay function:
void delay(int duration){ for(int i=0; i<=duration; i++){ for(int j=0; j<=10800; j++){
} }
}
sa main function call mo, db you called delay(); instead of dalay(60), make it delay(21600);
Sis, accurate ba ito? Hindi ba dependent yan sa speed ng processor?
|
|
|
|
|
Logged
|
There are only 10 types of people in the world; those who understand binary, and those who don't.
|
|
|
mini_mouse ^_^
Size C Battery
   
Pogi/Ganda Points: 4
Offline
Gender: 
Posts: 186
...All is Well...
|
 |
« Reply #17 on: March 12, 2010, 11:17:19 AM » |
|
...hmp... te-nest ko sa timer sa cp, med-u lng. hehehehe
|
|
|
|
|
Logged
|
...I'm thankful each and every day, coz I found you...
|
|
|
zeitcheist
Size AA Battery
  
Pogi/Ganda Points: 2
Offline
Gender: 
Posts: 114
|
 |
« Reply #18 on: March 12, 2010, 10:47:52 PM » |
|
un ung ask ko sa topic starter nito eh, kaso hindi na sumagot.. hehe.. kasi kung hindi naman need na accurate, pwede na yan.. ^^
|
|
|
|
|
Logged
|
There are only 10 types of people in the world; those who understand binary, and those who don't.
|
|
|
mini_mouse ^_^
Size C Battery
   
Pogi/Ganda Points: 4
Offline
Gender: 
Posts: 186
...All is Well...
|
 |
« Reply #19 on: March 15, 2010, 02:56:50 PM » |
|
..may error pala ata ang code ko kasi i'm using DevC++... dapat SYSTEM("cls"); yan instead of clrscr; tas include mo ang stdlib.h
#include<stdlib.h>
|
|
|
|
|
Logged
|
...I'm thankful each and every day, coz I found you...
|
|
|
|
The Philippine Electronics and Technology Forum
|
|
|
|
|
|
Logged
|
|
|
|
|