Showing posts with label DTP301. Show all posts
Showing posts with label DTP301. Show all posts

Saturday, May 01, 2010

Deskchecking


As part of your assessment you will need to perform a deskcheck. To find out more about the Whys and Hows of deskchecking, use Topic 6 of the Visual Basic Moodle course. You don't necessarily need to do all the examples but you do need to convince me that you can deskcheck from pseudocode, and that you know how to deal with loops.

Thursday, April 29, 2010

String Handling Part 2



Program Example 15 is also similar to a program we wrote in QBasic - the Sentence one. It counts the number of spaces to work out the number of words in a sentence. It also uses an array to keep track of how times each letter occurs in the sentence. New string functions are CHR and ASC.





Questions to answer:



  1. What is a pangram?
  2. What is ASCII?
  3. Explain what CHR and ASC do and give some examples.
  4. What is the significance of the ranges 65-90 and 97-122 in the comments of the blue-book-code?
  5. Explain what the AddToArray subroutine does from the time it is called until it ends. You may find it helpful to your understanding to sketch the Letters array.

Tuesday, April 27, 2010

String Handling



Remember strings? They are the data type that holds letters, spaces, words and text. In QBasoc we used



  1. LEN(mystring) to find the length of a string

  2. LEFT$(mystring, x) to find the first x characters of a string

  3. RIGHT$(mystring, x) to find the last x characters of a string

  4. MID$(mystring, y, x) to find x characters of a string starting at position y

A common technique used with strings is to use a FOR loop to cycle through the letters in the string:

FOR i = 1 to LEN(mystring)

PRINT MID$(mystring, i, 1)

NEXT i

What are the equivalent techniques for these functions in Visual Basic? See Program Example 14 String Handling 1.

Friday, April 23, 2010

Matrix



  1. Find my version of the matrix program in iNet and have a play with it.
  2. Can you fix the bug that has 1s and 2s showing up instead of 10s and 11s at one point?
  3. Do the first three suggestions for consolidation in the blue booklet.
  4. Describe how the cursor behaves in this program.
  5. What other cursor options are there?
  6. If you need to practice with random numbers and arrays do the tasks from the blue booklet.

Thursday, April 22, 2010

Pseudocode Task

1. Log in to Moodle and find Programming -> Visual Basic (Enrolment code is Oscar)
2. Find topic on Pseudocode.
3. Read resources and write pseudocode for Craps – hand in on paper for marking.

Diagrams Task

1. Check the posters over Melanie’s and Jonathan’s computers to remind yourself of flow charts and structure diagrams.

2. Make a structure diagram to show the “big picture” of the Number Game 1 program. Don’t spend more than 10 minutes attempting this – then see me OR find and read the file Planning for Visual Basic Programs. Use this method to make a similar plan for the Number Game 1 program.

3. Make a flow chart to show the details of the Compare button code.

4. Hand in for marking.

Wednesday, April 21, 2010

Moving Buttons


The Moving Buttons program is very annoying!

You can find it in iNet --> DigiTech by searching or using your brain.

To make it work, copy it to your desktop (or your home drive if you want to keep it.)

Run it and experiment.

Copy the code into a Word document.

Use the coloured high-lighter tool and a key to identify which part of the code does each of the "learning goals" from the blue booklet.

Choose one part of the code (one sub-routine) to explain in English.

Hand it in for marking or talk to me about it!