Quick Basic Combined:

Day 1 – Introduction & Basic Programming Techniques

The goal is to provide a general knowledge of the development environment for DOS based programming. Emphasis will be to understand the concepts of creating and running simple programs.

Topics Covered:

Demonstrations:

Print & Color

print 9

print 5

print "Hello"

print 5 + 9

print "5+9"

print "Hello" + " there!"

print "Hello";

print " there!"

end

Number Variables

a=5

b=3

print "a+b=";

print a+b

c=a-b

print "a-b=";

print c

String Variables

a$="1"

b$="2"

print a$ + b$

 

Input

print "What is your name";

input a$

print "Hello There " + a$

end

Input & Cls

print "What is your name";

input a$

cls

print "Hello there " + a$

end

Variable Errors

print "What is your name";

input a#

cls

print "Hello there " + a#

end

Sleep & Play

play "abcdefg"

sleep 1

play "fgedcba"

Locate

print "What is your name";

input a$

cls

locate 10, 10

print "Hello there " + a$

 

 

Assignments:

Colour Codes

Try the different numbers for the color statement to determine what each colour number does.

Number Adder

Use two variables to store to numbers. Add up the sum of the two numbers and print it out.

Simple Calculator

Read in two numbers as input and then calculate the sum of them and the difference eg. number1+number2 and number1 – number2

Day 2 – Advanced Programming Techniques & Graphics

The goal is to develop and introduce more advanced techniques used for computer programming such as conditional statements.

Topics Covered:

Demonstrations:

If Statement

print "What is your name";

input a$

if a$="Carman" then

print "hello " + a$

end

ElseIf Statement

print "What is your name";

input a$

if a$="Carman" then

print "hello " + a$

elseif a$="Joe" then

print "hey " + a$

end

Else Statement

print "What is your name";

input a$

if a$="Carman" then

print "hello " + a$

elseif a$="Joe" then

print "hey " + a$

else

print "How are you doing " + a$ + "?"

end

Generating Random Numbers

randomize timer

10 x=int (rnd * 6)

print x

goto 10

Pset

randomize timer

screen 13

10 x=int(rnd*320)

y=int(rnd*200)

c=int(rnd*256)

pset(x,y), c

goto 10

 

Assignments:

Calculator

Create a calculator that can do adding and subtracting. Ask the user what they would like to do: add or subtract, and then ask for two numbers. Output the result.

Name Game

Create a simple game that asks for information about a person like their age, name, hobbies, or favourite pastimes. Then based on what they answer, compare this to what you like. eg. if the person says they like basketball and you like basketball too, print "I like basketball too."

Happy Face

Design a program to show a happy face. Get it to randomly change its colours.

Day 3 – Advanced Programming Techniques

The goal is to develop and introduce more advanced techniques used for computer programming such as arrays and looping structures.

Topics Covered:

Demonstrations:

Do While Loop

Do while a$="Good"

print "How are you today"

input a$

loop

Do Until Loop

Do Until a$="Good"

print "How are you today"

input a$

loop

For Loop

For a=1 to 100

pset(a, a*2), 1

next a

For a=1 to 100 step 2

pset(a, a*2), 1

next a

Array of Numbers

dim a(10)

for n=0 to 9

a(n) = n

next

for n=0 to 9

print a(n)

next

Assignments:

Calculator

Design a calculator that can perform addition, subtraction, multiplication, and division. Ask the user initially which operation they would like to perform and then ask for two numbers. Print out the results of the operation. Loop to the beginning of the program and ask the user if they would like to do another operation. Loop until the user says they would like to Quit. A good idea is to display a menu of the functions: Add, Subtract, Multiply, Divide, or Quit

Adder

Input two numbers from the user. Add up the sum from the first number to the second number.

eg. if the first number is 2, and the second number is 6 2+3+4+5+6=20 print out 20

Palindrome

Write a program that asks the user for 5 numbers, the numbers can only be 0’s and 1’s. Store each number as an element in an array. If the order of the numbers is the same forward as backwards, output: The number is a palindrome.

eg. if the user enters in this series of numbers 0, 1, 1, 1, 0 then the number is the same both forward and backwards, it is a palindrome

eg. if the user enters in this series of numbers 0, 1, 0, 1, 1 then backwards it is 1, 1, 0, 1, 0

it is not the same forwards and backwards therefore it is not a palindrome

Day 4 – Simple Game Programming

The goal is to use the concepts learned through the week to develop a simple two-player game of tag.

Topics Covered:

Demonstrations:

Previous Classes’ Programs

Structure of the Tag Game

The game will involve two circles that start initially apart. One circle tries to chase the other circle. If the first circle touches the second circle then the first circle wins.

‘ screen dimensions are 320 x 200

‘ position 0, 0 is in the top left corner of the screen

Cls

X = 50 ‘ starting positions of circles

Y = 50

W = 300

Z = 100

Screen 13 ‘ switch screen modes to graphical

Circle (X, Y), 12, 1 ‘ draw two initial circles

Circle (W, Z), 12, 4

 

10 A$ = INKEY$ ‘ grab key press from keyboard

If A$ = "" Then GoTo 10 ‘ do nothing if no key pressed

If A$ = "w" Then ‘ if key pressed is w then move circle 1

Circle (X, Y), 12, 0 ‘ erase circle (draw in black)

Y = Y – 1 ‘ move y position up one

If Y = 0 Then Y = 199 ‘ check if at the top of screen

Circle (X, Y), 12, 1 ‘ wrap to bottom if true

End If

. ‘ other key presses go here

.

.

goto 10

Assignments:

Tag Game

Design the above simple game of tag using four keys on the keyboard for each player.

Day 5 – Project

The goal is to use the course material and programming concepts you have learned to create a simple program of your choice.

Topics Covered:

Demonstrations:

Previous Classes’ Programs

 

Assignments:

Program of Your Choice or Complete Tag Game

Finish the program of your choice.