Printer Friendly

Computer quest.

Here is a new program for your to enter on your IBM compatible computer. Programs presented here were written on the "BASIC" language for use on a PC computer. Since there are several different types of BASIC, you may not know which one is on your computer. The first step to entering a program will be to start the BASIC editor. Should the following procedure fail to start the BASIC editor, find someone who can help you get started.

1. Get the computer to display the "C:" prompt.

2. Try typing one of the following three commands: BASICA, GWBASIC, or QBASIC.

3. If you get an error message for all three, try typing CD/DOS and Enter. Then repeat step 2.

4. Once you have successfully entered the BASIC editor, type the program exactly as given. Be sure to include all spaces and punctuation marks, and don't get your 0 (zero) and Os mixed up.

5. After typing your program in, save it, using one of the following methods: BASICA, or GWBASIC - Type SAVE "name" where name is any 8 letter name you wish to use. QBASIC--Hit Alt, F, S keys then type any 8 letter name you wish to use.

6. To run the program without quitting the editor, type RUN for BASICA or GQBASIC; hit F5 if you have QBASIC

7. To type in another program without quitting the editor, type NEW nad Enter if you have BASICA or GWBASIC. If you have QBASIC hit Alt, F, N. Be sure to save your previous program first!

8. To recall your saved programs at a later date, enter the Editor using steps 1 and 2. Then for BASICA or GWBASIC type LOAD "name", where name is what you named the program. For QBASIC hit Alt, F, O, and type the name of your program.

DAY FINDER

100   REM DAY FINDER
110   KEY OFF: CLS : LOCATE 1, 34
120   D$(1) = "Sunday": PRINT "DAY FINDER"
130   D$(2) = "Monday": D$(3) = "Tuesday"
140   D$(4) = "Wednesday": D$ (5) = "Thursday"
150   D$(6) = "Friday": D$(7) = "Saturday"
160   LOCATE 5, 32: INPUT "Enter month"; M
170   LOCATE 7, 32: INPUT "Enter day"; D
180   LOCATE 9, 32: INPUT "Enter year"; Y
190   IF Y = 0 OR M > 12 THEN 320
200   IF Y < 1753 OR D > 31 THEN 320
210   K = INT (.6 + (1 / M))
220   L = Y - K: Q = M + 12 * K
230   P = L / 100
240   Z1 = INT (P / 4)
250   Z2 = INT (P)
260   Z3 = INT ((5 * L) / 4)
270   Z4 = INT (13 * (Q + 1) / 5)
280   Z = Z1 - Z2 + Z3 + Z4 +D - 1
290   Z = Z - (7 * INT (Z / 7)) + 1
300   LOCATE 14, 26
310   PRINT "That date falls on a "; D$(Z)
320   LOCATE 18, 27
330   PRINT "Do you want another? (Y/N) "
340   A$ = INPUT$(1)
350   IF A$ = "y" OR A$ "Y" THEN 110
360   CLS : KEY ON: END

This program will find the day of the week for any date after the year 1752. Enter the number of the month, day and year. The day of the week corresponding to that date will be displayed. You can try this on your date of birth to find out on what day of the week you were born. You can also use it to determine on what day of the week upcoming holidays will fall.

If you have something special you would like to see in this column or questions, write to:

COMPUTER EDITOR c/o BOYS QUEST P.O. Box 227 * Bluffton, OH 45817-0227

COPYRIGHT 2005 Bluffton News Printing & Publishing Co.
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2005 Gale, Cengage Learning. All rights reserved.

Article Details
Printer friendly Cite/link Email Feedback
Author:Weber, Ray
Publication:Fun For Kidz
Date:Sep 1, 2005
Words:592
Previous Article:The castaways!
Next Article:The ever-changing north star.
Topics:

Terms of use | Privacy policy | Copyright © 2021 Farlex, Inc. | Feedback | For webmasters |