General
Purpose Packages
Automated
Systems
Commercial Data
Processing
Computer Systems
Hardware
Computer Systems
Software
Programming Course
Arrangements

Useful Functions In Programming

Visual Basic Express contains certain functions that can make it easier to tidy up your programs and provide more flexibility in what the programs can do, without having to write too much complicated code.

The main functions that you will consider from this point onwards are shown below:

 

Function

Example

Int - This provides the integer part of a number.

Int(number) will provide the value 4 if a variable called number contains the value 4.4 (or even 4.9 - Int does not round the number)

Cint - provides the integer rounded to the nearest integer Cint(number)will provide the value 4 if a variable called number contains the value 4.4.
Ucase - Converts a string value to all uppercase letters. Ucase(name) will provide the value HAMISH if the user has entered Hamish (or even HAMisH) into a string variable called name.
Lcase - Converts the string value to all lowercase letters. Lcase(name) will provide the value hamish  if the user has entered Hamish (or even HAMisH) into a string variable called name.
Rnd - Creates a random number (considered previously). number = int(rnd*10)+1 places a whole random number between 1 and 10 into a variable called number.

 

What you have to do!

  1. Open the program Average2.
  2. Change the program so that the output only displays the average rounded to the nearest integer.
  3. Tick off your Progress Grids.

 

 

 

What you MAY have to do!

Ask your teacher whether you should do the following task.

 

Assessment 6 (A6). Complete the assessment LANGUAGE COURSE in your progress grids

 

 

When you complete an exercise make sure you mark it off in your progress grids.

 

What you should be able to do at the end of this unit!

 

 


 

 

 

 

Home | S1 Topics | S2 Topics
Computing Standard Grade | Info Systems Intermediate II | Info Systems Higher | Internet Safety
Log into Glow | School Website | Contact Us