Wednesday, 16 September 2015

Class 8 - Declaring a variable

Declaring a variable is used to reserve space in memory.  There are 2 types of variable declaration:
  • Implicit declaration
  • Explicit declaration
Implicit Declaration :

Whenever VB comes across a variable, it is assigned a default data type. 

Explicit Declaration :

When the user wants to specify the data type of the variable, then it is called declaring explicitly.

Dim statement is used to declare a variable.

Syntax :

dim variable name as data type

Example :

dim a,b,c as Integer
 dim m as single, i,j as Integer

String variable declaration :

String declaration is little different from other data type declaration.
There are two types of string declaration.

  • Variable Length
  • Fixed Length
If  we want to enter a data of any length then it is variable length.

dim name as string

If we want to enter a data with a particular length, then it is called fixed length.

dim name as string * 3

In the above example we can enter a string with 3 characters only.


Assigning a value :

Once the variable is assigned a data type, the value should be given to it.
To declare and assign  one variable :
dim a as integer  
a=100  

or
dim a as integer = 100

To declare more than one variable :

dim a,b,c as integer
a=10
b=20
c=30


Tuesday, 15 September 2015

Class 8 - Date Function








Class 8 - Introduction

Visual Basic

Visual basic was derived from the language BASIC. 

BASIC has its own limitations., it is a simple programming language but used only in a text based environment. But visual basic is

  • User friendly

  • Supports Graphical User Interface(GUI)VB

VB is an Event- driven programming, which means the flow of the program is determined by an Event.

An Event is an action performed either by mouse click, double click or pressing keys on the keyboard.

 Integrated Development Environment describes the interface and the environment we use to create our own applications.

 1. Form design window
 2. Tool box

 3. Menu bar

 4. Project explorer

 5. Properties window

 6. Form layout


Project Explorer Window
             
              It lists all the forms in the project. The components of the window are:
  • View code
  • View object
  • Toggle folders
  • Project name
  • Forms folder
  • form module


Properties Window

              It displays the properties like font name, caption, background colour etc of the selected object on the form.

A form is saved with an extension  .frm .
A project is saved with an extension .vbp .

        To execute the visual basic program :
  •         Click Run from Start option
  •         Click start on the Toolbar
  •         Press F5 key
                      

Class 8 - Data Type in VB

A data type determines what type of values a variable can hold.
In numbers we have different types like 5(whole number), 6.9(decimal number).

The computer memory is made up of storage areas which will hold the values. 

When we give a value to a variable, the computer will allocate space in the memory to hold the variable. The storage space will be different for different values, based on the type of value.

Data types   :

Natural Numbers 

  • byte
  • integer
  • long
Byte : Number ranges from 0 to 255.
Integer : Larger than byte. Ranges from -32,768 to 32,767
Long : It can hold more than integer. To store very large number.

Decimal Numbers 

  • Single
  • Double

Single : To store decimal values. Less Precision.
Double :  Large decimal numbers. Very precise values.

String  :
It is also called alphanumeric (i.e) alphabets and numbers. It can be a word, group of words, numbers .

Boolean :
This value can be either true or false.

Variant :
It can represent any value.

Date :
It stores vales from 1/1/100 to 12/3/9999.

Friday, 21 August 2015

Class 8 - Operators

Ch : 5 Operators and Functions

In this chapter we are going to learn about the basic steps such as variable, data type, operator in writing a program.
 
1. Variable :
 
The value is going to change every time.
 
x=3 , here x is a variable.
 
Rules for naming a variable :
1. First character should be a letter.
2. Other characters may be letter,digit.
3. No special characters except underscore( _ ).
4. Maximum limit is 255 characters.
5. Keywords are not allowed.
 
Examples :
1. a   -  Valid variable
2. s1  - Valid variable
3. Computer_Science - Valid variable
 
Identify the valid and invalid variables :
1.  _123              - Invalid variable(Should start with an alphabet)
2.  Bond007        - Valid variable
3.  Cotton  Boys  - Invalid variable(Special character space)
4. Middle      - Valid variable
5. ProgRam   - Valid variable
6. A * b         - Invalid variable(Special character *)
 
 


Class Schedule

24th August to 1st September

Std 7 :

Lab :

Ch 7: Formatting tags (bold,italics,underline,center,superscript,subscript,hr and image tags)

Theory :
Ch 7 exercise and Ch :8 Lists

Std 8 :

Ch 4 :

Lab :

 Designing forms in the lab (command button, msg command, Checkbox Option button)

Theory :

Ch 5: 
Operators((Data types, Declaring a variable, Assigning a value)

Std 9 :

Lab : Ms Excel 

Simple programs in Java using Blue J method.

Introduction to scanner.

Std 10 :

Lab : String programs.

String functions(substring , charAt,trim,endswith,startswith,toUpperCase, toLowerCase)





Thursday, 20 August 2015

Class Schedule

17th August to 21st August

Std 7 :

Ch 7: Formatting tags (bold,italics,underline,center,superscript,subscript,hr and image tags)

Std 8 :

Ch 4 :

 Designing forms in the lab (Label,Textbox,commandbutton)

Ch 7: 

Operators(Arithmetic and Relational ).

Std 9 :

Lab : Ms Excel 

Simple programs in Java using Blue J method.

Std 10 :

Lab : Constructors and String programs.

String functions(substring , charAt,trim,endswith,startswith)