06-06-2020, 05:26 +0200
Forum: Overview#tclchannel related questions
Test your TCL Skill.
 Announcement
12-02-2005, 15:40 by CyBex | BANs 
English: If you are banned in #Tcl, you can ask here to remove it. If you have a special reason in your kickmsg, remove your fault and leave us here a note.

Deutsch: Wenn du in #Tcl gebannt bist, kannst du hier nachfragen ob wir ihn entfernen können. Hast du einen besonderen Grund in der Kickmsg, behebe erst das Problem und hinterlass uns hier eine Notiz..

Good Luck..

AuthorPost
Gotisch  06-12-2006, 21:33   | Problem #1 ICQ
(Moderator)
Member since 01/2006
19 Posts
Location: Europe
                                                                                                                              
01
02
03
04
05
06
07
08
09
10
11
Given a time in numbers we can convert it into words. For example:

5:00 Five o'clock
5:10 Ten minutes past five
5:15 Quarter past five
5:30 Half past five
5:45 Quarter to six
5:47 Thirteen minutes to six

1
Write a program which inputs two numbers (the first between 1 and 12, the second between 0 and 59 inclusive) and then prints out the time they represent, in words. You should follow the format of the examples above. Your program should then terminate.


Language: TCL

Try to write this on your own. When your done post your responce here if you want. And maybe write why yours is better :)

This Problem is taken from Round 1 of BIO'97

SampleSolution as attachment;
Run gives:
                                                                                                                              
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
C:\Dokumente und Einstellungen\Gotisch\Eigene Dateien>tclsh ClockSolution.tcl
ClockSolution (c) Gotisch
Please enter the hour(01-12):01
Please enter the minute(00-59):45
Its quarter to two

C:\Dokumente und Einstellungen\Gotisch\Eigene Dateien>tclsh ClockSolution.tcl
ClockSolution (c) Gotisch
Please enter the hour(01-12):01
Please enter the minute(00-59):00
Its one o'clock

C:\Dokumente und Einstellungen\Gotisch\Eigene Dateien>tclsh ClockSolution.tcl
ClockSolution (c) Gotisch
Please enter the hour(01-12):17
Please enter the minute(00-59):30
Its half past five

C:\Dokumente und Einstellungen\Gotisch\Eigene Dateien>

This post was edited 2 times, last on 06-12-2006, 22:34 by Gotisch
  The user has attached a file: ClockSolution.tcl (Save, 1,332 Bytes, downloaded 148 times)
Advanced options for this topic:

Ignore this topic (Do not list this topic in the "unread topics" search. You are currently not ignoring this topic.)
Hide this topic (Hidden topics are not displayed in the topics list. This topic is currently not hidden.)
Go to forum

Unclassified NewsBoard 1.5.3-d | © 2003-4 by Yves Goergen | Time: 153.5 msec, CPU time: 61.2 msec, 31 Database queries in 114.1 msec | 3.8 kB (13.7 kB) | Timezone: +0200