hello world basic tutorial nova southeastern university cristal locke this presentation is...

35
Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved.

Upload: eleanor-ramsey

Post on 18-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Hello World

Basic TutorialNova Southeastern UniversityCristal Locke

This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved.

Page 2: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Obtaining the Software

True Basic Bronze 5.41a can be purchased on-line for $39.00 from www.truebasic.com. The compiler includes a 250 page guide for True Basic Bronze.

Page 3: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Brief History of BASIC

In 1964, John G. Kemeny and Thomas E. Kurtz, Professors of Mathematics at Dartmouth University, developed Beginner’s All Purpose Symbolic Instruction Code (BASIC). The language was created for the General Electric 225, and it was meant to be simple to learn, easy to translate, and a stepping stone for learning more powerful languages.

John Kemeny

Thomas Kurtz

Page 4: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

In 1974, Bill Gates, a student at Harvard University, and Paul Allen, an employee at Honeywell, developed a Basic language for MITS’ Altair, the first personal computer. MITS liked the product and it was licensed to the company by Mr. Gates and Mr. Allen. The success of the language encouraged the businessmen to take their product to Seattle, where they attended grade school together. By the late 1970’s, Apple, Commodore, and Atari were supporting Basic.

Paul Allen

Page 5: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

In the mid 1980’s, Mr. Gates developed a DOS-Basic interpreter. There was an IBM-DOS version called BASICA, which was distributed with all IBM computers, and a MS-DOS version called GW-DOS, which ran on any machine that ran DOS. The two programs were not very different.

Bill Gates, Microsoft Chairman

Page 6: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

In the late 1980’s, Tim Button, Product Manager at Microsoft, led a team that developed QuickBasic. The updated language allowed users to code programs that ran without an interpreter. This version was distributed and upgraded continuously until it reached version 4.5. At that time, Microsoft developed Professional Development System Basic (PDS Basic), which continued upgrading until version 7.1 (also known as Quick Basic Extended). Microsoft was successful in its use of graphical user interfaces (GUI’s) and this led to the development of Visual Basic for DOS and Windows. Visual Basic became very successful in 1991 when version 2.0 was released. Version 3.0 became the fasted growing compiler in the market.

Page 7: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Before you begin to install, make sure that you exit all windows programs that are currently

running.

Page 8: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Installing the Software

1. Place the disk into the CD-Rom drive (in many cases it is the D drive, however this may vary depending on the computer you are using).

2. Sometimes the program will begin the installation process on its own. If this happens, skip steps 3, 4, & 5. Instead, go to step 6.

Page 9: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

3. Double click on My Computer on your desktop

Page 10: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

4. Double click on the BRONZE icon, which should be the same icon as your CD-ROM drive.

Page 11: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

5. Double click on setup.exe.

Page 12: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

6. A blue screen will appear advising of copyright laws. Read the information and click next.

Page 13: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

7. The next screen gives you an opportunity to change the directory in which you wish to save the program. Click on the Next button to continue.

Page 14: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

8. True Basic will create a folder for you and place the program in your Program Folder. Click Next to continue.

Page 15: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

9. Click on Next to continue.

Page 16: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

10. Setup will run, which installs the program to your computer.

11. When setup is complete, click on the Close button.

Page 17: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Starting the Program

1. Click on the Start button on the lower left hand side of your screen.

2. Go to Programs, then to True Basic Bronze Edition, and finally click on TB Bronze.

Page 18: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

3. The program will begin and a screen will appear like the one below.

Page 19: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Setting up Your Compiler1. Click on New.

Page 20: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

2. Click on File and Save and type helloworld.exe in the File name window. Click Save.

Page 21: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Hello World Program

1. Type the following into your Helloworld.exe window:

REM Hello WorldPRINT "Hello World!"PRINTPRINT "This is my 1st Basic program."PRINTPRINT "I used True Basic, which is a Windows

based program."END

Page 22: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

2. Click on Run and then Run from the menu at the top of the screen.

Page 23: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

3. Your first program will run on a DOS based screen.

4. In order to exit the program, hit any key.

Page 24: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Saving Your Program

After all of that work, I have to assume you want to save your

work of art!

Saving your work is important so that you will not have to start over

when you return.

Page 25: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

1. Click on File and then Save from the menu at the top of the screen.

Page 26: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

2. Click on File and Close to close your creation.

Page 27: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Samples

The following slides are small programs created to show some common commands used in BASIC.

In order to use the samples, click on New and type the data in the box. Don’t forget to save your program!

Page 28: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

INPUT and PRINT Commands

PRINT "What is the length of the rectangle."INPUT lengthPRINTPRINT "What is the width of the rectangle"INPUT widthPRINTPRINT "Length", "Width", "Area"PRINT length, width, length*widthEND

Page 29: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

GOTO Command

60 PRINT "Please type a value for X."70 INPUT x80 IF x > 3 THEN GOTO 6090 IF x < 3 THEN GOTO 100100 PRINT "You're done"110 END

Page 30: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

FOR NEXT Command

FOR I = 1 to 20PRINT I;NEXT IPRINTFOR I = 20 TO 1 STEP - 1PRINT INEXT IEND

Page 31: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

IF THEN Command

PRINT "Please type a value for X."INPUT xPRINTPRINT "Please type a value for Y."INPUT yPRINT IF x = y THEN PRINT "x = y The numbers are the same"IF x < y THEN PRINT "x < y The second number is greater than the first number"IF x > y THEN PRINT "x > y The first number is greater than the second number"END

Page 32: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Learn MoreTrue Basic has a

built in tutorial that can be

accessed from the Help for True BASIC dropdown menu at the top of the screen.

The tutorial can be used to answer any

questions that may arise about

commands, functions, menus, or

statements.

Page 33: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

True Basic Bronze, Edition Guide is included with the purchase of the compiler. This book is an excellent resource that includes an appendix with an alphabetical listing of statements, built-in functions, and error message explanations.

Kemeny, J. & Kurtz, T. (2002). True BASIC bronze edition guide. Hartford: True BASIC, Inc. ISBN: 0-939553-39-2

Page 34: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Contact Information

Cristal Locke can be contacted through e-mail at [email protected] or through

http://tucker.dade.k12.fl.us/classrooms/Locke/gifted.htm

This tutorial was created on August 5, 2002.

Page 35: Hello World Basic Tutorial Nova Southeastern University Cristal Locke This presentation is copyrighted by Cristal Locke, August 5, 2002. All rights reserved

Permissions

Permission is hereby given to Nova Southeastern University students, who are taking WebCT courses, to use this presentation.

Cristal Locke, August 5, 2002