![]() |
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!
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!