Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Saturday, December 8, 2012

Introduction to VB


For a complete list, click VB

and to know basic tools , Know VB Tools


When we open VB , we can see a new window as ; 


Select Standard EXE and click Open.
Then ,




Saving a VB Program :

File --> Save Project .
We can save a program as .frm and .vbp 

At first , we will save the file as .frm 



A file with .frm  extension , is 

When saving the same file as .vbp ,



We get a file like this : 


==========================================================================
From "Microsoft Visual Studio" (Click here to download) , we can run a VB program . Follow the steps given below :

(We already used this in the page "ASP.NET - Introduction").

  • Open "Microsoft Visual Studio",

  • Then we can see the HOME page .



  • Select "New Project" .Then we can see,



  • Select "Visual Basic" and then "Windows Form Application" .It will lead you into a page 

When we click "Tool Box" in the left side of the form, we will get all the tools as described in VB Tools .
(If you can't see any of the tools , please select " Window -->Reset window layout" . It will reset with all the pre-defined options.


---------------------------------------------------------------------------------------------------------------------
Click to get a  Sample Program .....

Thursday, September 20, 2012

CJ-26 : Student Details[Inheritance(1)]

Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer

Introduction to JAVA 

before doing any JAVA Programs.
***********************************************************************************************
***********************************************************************************************
import java.io.*;
public class student 
{
int regno;
String name,grade,branch;
void read()
{
DataInputStream x=new DataInputStream(System.in);
try
{
System.out.println("Enter register number :");
regno=Integer.parseInt(x.readLine());
System.out.println("Enter student name :");
name=x.readLine();
System.out.println("Enter branch :");
branch=x.readLine();
System.out.println("Enter Grade :");
grade=x.readLine();
}
catch(Exception e)
{
}
}
}
class office extends student
{
int deptno;
void display()
{
DataInputStream x=new DataInputStream(System.in);
try
{
System.out.println("Enter department number :");
deptno=Integer.parseInt(x.readLine());
}
catch(Exception e)
{
}
System.out.println("Name ="+name);
System.out.println("Branch ="+branch);
System.out.println("Grade ="+grade);
System.out.println("Department Number ="+deptno);
}
}
class inherit
{
public static void main(String[] args) 
{
office s1=new office();
s1.read();
s1.display();
}
}
===================================
Predict the output...OK???

Sunday, September 16, 2012

CPP-1 : First Program to display a message


  • Compile the program using AltF9 , and then run the program using ControlF9.
    Save the file as name.CPP .That is , name of the file , followed by .CPP(dot CPP).
    Here I named the program "Firstprgrm." So, save it as Firstprgrm.CPP.
    ================================================================

    #include<iostream.h>
    #include<conio.h>
    void main()
    {
    clrscr();
    cout<<"My first C++ Program";
    getch();
    }
    =====================================
    Output : 
    My first C++ Program

Tuesday, September 4, 2012

CJ-25 : Addition using constructors

Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer

Introduction to JAVA 

before doing any JAVA Programs.
*********************************************************************************************
*********************************************************************************************
import java.io.*;
class add
{
    int a,b,c;
    add()
    {
    }
    add(int x,int y)
    {
            a=x;
            b=y;
            c=a+b;
            System.out.println("Addition ="+c);
    }
 }
class sub
{
    int n,m,s;
    sub()
    {
    }
    sub(int h,int j)
    {
        n=h;
        m=j;
        s=n-m;
        System.out.println("Subtraction ="+s);
    }
}
public class con1 
{
    public static void main(String args[])
    {
        add a=new add(10,20);
        sub b=new sub(60,20);
    }   
}
=========================================================================
Output : 
Addition =30
Subtraction =40





Monday, September 3, 2012

CJ-24 : Enter student details using 2 functions

Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer

Introduction to JAVA 

before doing any JAVA Programs.
***********************************************************************************************
Refer Program to enter Student Details also.
***********************************************************************************************

import java.io.*;
class student1
{
    int rno;
    String name, branch;  
    void get()
    {
     
        try {
            DataInputStream x = new DataInputStream(System.in);
            System.out.println("Enter Roll Number");
            rno = Integer.parseInt(x.readLine());
            System.out.println("Enter Name");
            name = x.readLine();
            System.out.println("Enter Branch");
            branch = x.readLine();
        } catch (Exception e) {
           
        }
    }

    void display() {
        System.out.println(" ");
        System.out.println("=========================");
        System.out.println("STUDENT DETAILS :");
        System.out.println("-----------------");
        System.out.println("Roll Number =" + rno);
        System.out.println("Name =" + name);
        System.out.println("Branch =" + branch);
    }
}


    class exam
    {

        int regno, mark;

        void read() {
            try {
                DataInputStream x = new DataInputStream(System.in);
                System.out.println("Enter Register Number");
                regno = Integer.parseInt(x.readLine());
                System.out.println("Enter mark");
                mark = Integer.parseInt(x.readLine());
            } catch (Exception e) {
               
            }
        }

        void write() {
            System.out.println("=========================");
            System.out.println("EXAM DETAILS :");
            System.out.println("--------------");
            System.out.println("Register Number =" + regno);
            System.out.println("Mark =" + mark);
        }
    }
 

        class main1
        {

            public static void main(String args[]) {
                student1 s = new student1();
                exam e = new exam();
                s.get();
                e.read();
                s.display();
                e.write();

            }
     
    }

=========================================================================
Output : 


Enter Roll Number
1
Enter Name
Priyada
Enter Branch
Computer Science
Enter Register Number
746092
Enter mark
500
 =========================
STUDENT DETAILS :
-----------------
Roll Number =1
Name =Priyada
Branch =Computer Science
=========================
EXAM DETAILS :
--------------
Register Number =746092
Mark =500





Sunday, September 2, 2012

CJ-23 : Run-time error in Java

Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer

Introduction to JAVA 

before doing any JAVA Programs.
***********************************************************************************************

import java.io.*;
public class error
{
    public static void main(String args[])
    {
            int a[]={5,10};
            int b=5;
            try
            {
                int x=a[2]/b-a[1];
            }
            catch(ArithmeticException e)
            {
                System.out.println("Division by zero");
            }
            catch(ArrayIndexOutOfBoundsException e)
            {
               System.out.println("Array Index error"); 
            }
            catch(ArrayStoreException e)
            {
                System.out.println("Wrong data type");   
            }
            
            int y=a[1]/a[0];
            System.out.println("y ="+y);  
     }
    }

=========================================================================
Output : 

Array Index error
y =2
========================================================================
Note
Given that,  int a[]={5,10}; 
That is , a[0]=5 and a[1]=10.

According to the formula given in the program , int x=a[2]/b-a[1];
But, there is no element in a[2].
So, the run-time error occured, and the println statement Array Index error displayed.

Then the program will end there and begin with the next catch statement  int y=a[1]/a[0];
That is , a[0]=5 and a[1]=10. And the result is 2.
========================================================================

Thursday, August 30, 2012

CJ-22 : Check user name and password

Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer

Introduction to JAVA 

before doing any JAVA Programs.
***********************************************************************************************
import java.io.*;
public class string 
{
    public static void main(String args[])
    {
        String pass,user;
        try
        {
            DataInputStream x=new DataInputStream(System.in);
            System.out.println("Enter user name :");
            user=x.readLine();
            System.out.println("Enter password :");
            pass=x.readLine();
            if(user.equalsIgnoreCase("Priyada")&&pass.equals("java"))
                    {
                        System.out.println("LOGIN");
                    }
                    else
                       {
                              System.out.println("Invalid user name or password"); 
                       }     
        }
     catch(Exception e)
     {
     }
  }
}
=========================================================================
Output : 
Here, I am giving the user name as "Priyada" and password as "java"    .
In this program , only password is case sensitive.
In the output , if we give the correct user name and password, a message will appear as "LOGIN".
Otherwise , "Invalid user name or password"will be displayed.

run:
Enter user name :
priyada
Enter password :
java
LOGIN


==================================================================
Note : 

We can give LOGIN table as shown below : 



The program to draw table like this , will follow soon.....

Wednesday, August 29, 2012

CJ-21 : Program to enter Student Details

Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer

Introduction to JAVA 

before doing any JAVA Programs.
***********************************************************************************************
Refer Enter student details using 2 functions also.
***********************************************************************************************
import java.io.*;
public class student 
{
    public static void main(String args[])
    {
        int rno;
        String name,branch;
        try
        {
            DataInputStream x=new DataInputStream(System.in);
            System.out.println("Enter Roll Number :");
            rno=Integer.parseInt(x.readLine());
            System.out.println("Enter Student Name :");
            name=x.readLine();
            System.out.println("Enter Branch :");
            branch=x.readLine();
            System.out.println("==========================");
            System.out.println("Roll Number ="+rno);
            System.out.println("Name ="+name);
            System.out.println("Branch ="+branch);
        }
        catch(Exception e)
        {
        }
        }
 }
=========================================================================
Output : 


Enter Roll Number :
1
Enter Student Name :
Priyada
Enter Branch :
Computer Science
==========================
Roll Number =1
Name =Priyada
Branch =Computer Science