caramoan tour package

caramoan tour package

Author Topic: stopwatch in turbo c...  (Read 1329 times)

Offline mauryn

  • LR44 Battery
  • *
  • Posts: 1
  • Pogi/Ganda Points: 0
stopwatch in turbo c...
« on: October 06, 2008, 01:16:56 PM »
patulong naman po sa project ko.. gagawa na stopwatch using c program.. ganito po sya oh...

CMSC 11 – Introduction to Computer Science
Second Machine Problem
Project title: Stopwatch program
Objectives
---
Program specifications
The main goal of this project is for you to write a program that displays a running stopwatch. The time is displayed in hours:minutes:seconds with leading zeroes(00:00:00). The 12-hour time format will be used. The program will contain three versions and they are the following:

   Version 1:
   The user will enter the number of seconds that the stopwatch should run starting at 00:00:00.
   Version 2:
   The user will enter the number of seconds that the stopwatch should run starting at the equivalent time in hours, minutes, and seconds of the input. The stopwatch runs until the time becomes 00:00:00.
Version 3:
The user will be asked to press a key in order to start the stopwatch running beginning at 00:00:00. The stopwatch stops running as soon as the user presses a key.

Instead of displaying the time as 00:00:00, this project will also require you to develop a program that simulates light-emitting diode (LED) displays. These are commonly used for digital clocks or the timers of microwave ovens. Your program should be able to print the digits 0 through 9 as block digits(like you would find on led displays). Each digit should contain only the x and characters (see example below), and should be followed by a blank line so the digits are separated. You could also use other pairs of characters if you like.




XXXXX    XXXXX            XXXXX     XXXXX            XXXXX    XXXXX       
X . . .X   X . . .X      .     X . . .X    X . . . .     .     X . . .X   . . . . X
X . . .X   X . . .X            X . . .X    XXXXX            X . . .X   X . . .X
X . . .X   X . . .X      .     X . . .X    X . . .X     .     X . . .X   X . . . .
XXXXX    XXXXX            XXXXX     XXXXX            XXXXX   XXXXX

Implementation
The digit representation is  5 characters wide and 5 characters in height. Thus, you could store each digit representation in a 5x5 character array. Here are some functions that you can use:
kbhit(), defined in conio.h, returns 0 if no key has been hit; non-zero otherwise. You might use a function like this to break from a loop. Example:
         if(kbhit()!=0)break;/*if a key is pressed, break from a loop*/
You could also use delay(time) function, defined in dos.h, in order to halt program execution for time number of milliseconds. For example, the code below delays printing of the string “Hello World” for 2000 millisecinds(2 seconds) before the clrscr() function is executed.
printf(“Hello world”);
delay(2000)’
clrscr();

Break up your program into functions so that it will be easier to write, maintain, and debug. Please add comments on your source code for additional documentation so that your program is easier to understand. Use descriptive variable and function names and observe proper indention of statements.
Additional enhancements to the program shall be added at your discretion. Do not sacrifice the basic functionality of the project in favor of your add-ons.

pls.. sana po matulungan nyo po ako..
salamat po sa kung sino man gusto tumulong sa kin... :'(

Philippine Electronics Forum

stopwatch in turbo c...
« on: October 06, 2008, 01:16:56 PM »

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: stopwatch in turbo c...
« Reply #1 on: October 07, 2008, 06:15:22 PM »
post nyo lang po dito pag may tanong kayo...
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Philippine Electronics Forum

Re: stopwatch in turbo c...
« Reply #1 on: October 07, 2008, 06:15:22 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com