这个C程序输出一个挂钟。程序中有两个不同的选项。第一个只输出一个简单的挂钟,第二个输出一个带有一些附加细节的更具图形化的挂钟。
这需要系统时间蚂蚁开始滴答。它计算时间并相应地移动指针。可以作为一个It项目的学生在二年级或作为一个文凭小项目。现在得到这个免费软件项目,不要忘记在使用它之前删除代码中的html标签。这可以通过ms word上的查找和替换选项来完成。将此作为我们的软件工程项目之一。也可以作为软件工程项目使用。
for(k=0;k<=12;k++)
{
if(h==0)
h=360;
delay(1000);
drawclock();
for(j=0;j<=60;j++)
{
if(m==0)
m=360;
setcolor(4);
sector(320,150,m,m+1,75,75);
m=m-6;
delay(1000);
drawclock();
for(i=0;i<=60;i++)
{
setcolor(4);
sector(320,150,h,h+3,60,60);
setcolor(4);
sector(320,150,m,m+1,75,75);
if(s==0)
s=360;
setcolor(1);
sector(320,150,s,s+1,80,80);
sound();
s=s-6;
delay(1000);
drawclock();
if(kbhit())
exit(0);
}
setcolor(6);
sector(320,150,h,h+3,60,60);
}
}
getch();
}
void drawclock()
{
cleardevice();
setbkcolor(15);
setcolor(1);
circle(320,150,80);
setcolor(5);
circle(320,150,95);
circle(320,150,1);
outtextxy(314,58,”12″);
outtextxy(268,70,”11″);
outtextxy(235,105,”10″);
outtextxy(233,147,”9″);
outtextxy(241,190,”8″);
outtextxy(273,225,”7″);
outtextxy(318,238,”6″);
outtextxy(362,225,”5″);
outtextxy(392,190,”4″);
outtextxy(403,147,”3″);
outtextxy(393,105,”2″);
outtextxy(361,70,”1″);
outtextxy(302,200,”TILAK”);
}
void intro()
{
int i;
int u=installuserfont(“TSCR.CHR”);
settextstyle(u,0,7);
outtextxy(175,100,”TILAK’s”);
outtextxy(250,200,”CLOCK”);
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 1);
outtextxy(380,400,”Loading..”);
for(i=0;i<510;i++)
{
setcolor(15);
rectangle(50,100,50+i,110);
delay(5);
}
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 1);
outtextxy(380,400,”Loading….”);
for( i=0;i<510;i++)
{
setcolor(4);
rectangle(50,100,50+i,110);
delay(5);
}
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 1);
outtextxy(380,400,”Loading……”);
for(i=0;i<510;i++)
{
setcolor(15);
rectangle(50,200,50+i,210);
delay(5);
}
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 1);
outtextxy(380,400,”Loading……..”);
setfillstyle(SOLID_FILL,1);
fillellipse(320,205,6,6);
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 1);
outtextxy(380,400,”Loading……….”);
for(i=0;i<510;i++)
{
setcolor(15);
rectangle(50,300,50+i,310);
delay(5);
}
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 1);
outtextxy(380,400,”Loading…………”);
for( i=0;i<510;i++)
{
setcolor(2);
rectangle(50,300,50+i,310);
delay(5);
}
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 1);
outtextxy(380,400,”Loading…………..”);
delay(1000);
}
void sound()
{
sound(2000);
delay(100);
nosound();
}