17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

Chapter 3<br />

Reviewing and Practicing GW-BASIC<br />

The practice sessions in this chapter will help you review what you have learned. If you have not<br />

done so, this is a good time to turn on your computer and load the GW-BASIC Interpreter.<br />

3.1 Example for the Direct Mode<br />

You can use your computer in the direct mode to perform fundamental arithmetic operations.<br />

GW-BASIC recognizes the following symbols as arithmetic operators:<br />

Operation GW-BASIC Operator<br />

Addition +<br />

Subtraction -<br />

Multiplication*<br />

Division<br />

/<br />

To enter a problem, respond to the Ok prompt with a question mark (?), followed by the<br />

statement of the problem you want to solve, and press the RETURN key. In GW-BASIC, the<br />

question mark can be used interchangeably with the keyword PRINT. The answer is then<br />

displayed.<br />

Type the following and press the RETURN key:<br />

?2+2<br />

GW-BASIC will display the answer on your screen:<br />

?2+2<br />

4<br />

Ok<br />

To practice other arithmetic operations, replace the + sign with the desired operator.<br />

The GW-BASIC language is not restricted to arithmetic functions. You can also enter complex<br />

algebraic and trigonometric functions. The formats for these functions are provided in Chapter 6,<br />

"Constants, Variables, Expressions and Operators."<br />

3.2 Examples for the Indirect Mode<br />

The GW-BASIC language can be used for functions other than simple algebraic calculations.<br />

You can create a program that performs a series of operations and then displays the answer. To<br />

begin programming, you create lines of instructions called statements. Remember that there can<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/Chapter%203.html (1 of 5)28/03/2004 21.28.59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!