Sunday, January 13, 2013

Mini Project VB


Visual Basic is a third-generation event-driven programming language and integrated development environment  from Microsoft for its COM programming model first released in 1991. Visual Basic is designed to be relatively easy to learn and use. Visual Basic was derived from BASIC and enables the rapid application development of graphical user interface  applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. VBA is effectively the same language as Visual Basic but VBA-code is tied to Microsoft Office and can only run within that environment. The scripting language VBScript is a subset of Visual Basic.
A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations. Though the program has received criticism for its perceived faults, from version 3 Visual Basic was a runaway commercial success, and many companies offered third party controls greatly extending its functionality.




Visual Basic was designed to be easily learned and used by beginner programmers. The language not only allows programmers to create simple GUI applications, but to also develop complex applications. Programming in VB is a combination of visually arranging components or controls on a form, specifying attributes and actions of those components, and writing additional lines of code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code. Performance problems were experienced by earlier versions, but with faster computers and native code compilation this has become less of an issue.
Although VB programs can be compiled into native code executables from version 5 onwards, they still require the presence of runtime libraries of approximately 1 MB in size. Runtime libraries are included by default in Windows 2000 and later, however for earlier versions of Windows.




Examples:

     Private Sub Command 1_Click()
      Text1.Text = "Sathya"
      Text2.Text = "24"
      End Sub
    Private Sub Form_Load()
    Me.WindowState = 2
     End Sub
output :









Program 2:
Dim a, b As Integer
Private Sub Command 1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
Text3.Text = a + b
End Sub
Private Sub Command 2_Click()
a = Val(Text1. Text)
b = Val(Text2. Text)
Text3.Text = a - b
End Sub
Private Sub Command 3_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
Text3.Text = a * b
End Sub
Private Sub Command 4_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
Text3.Text = a / b
End Sub
Private Sub Command 5_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command 6_Click()
Unload Me
End Sub
Output:












Program 5:
 In coding window change       Tools        Add Procedure        Name Swap        Click Function
Private Sub Command1_Click()
SWAP Text1.Text, Text2.Text
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub             
Public Function SWAP(ByRef a As Integer, ByRef b As Integer)
Text1.Text = b
Text2.Text = a
End Function
Private Sub Command3_Click()
End
End Sub
Output: Before Swapping:
After Swapping:
Program 6:
Dim p, q As Integer
Private Sub Command1_Click()
p = Text3.Text
q = Text4.Text
Text5.Text = p * q
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.WindowState = 2
End Sub
Output:
Program 7:
Dim p, n, r As Integer
Private Sub Command1_Click()
p = Text1.Text
n = Text2.Text
r = Text3.Text
Text4.Text = p * n * r / 100
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.WindowState = 2
End Sub
Output:
Program 8:
Private Sub Command1_Click()
Text3.Text = Text1.Text + Text2.Text
End Sub
Private Sub Command2_Click()
Text3.Text = Len(Text1.Text + Text2.Text)
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Me.WindowState = 2
End Sub
Private Sub Option1_Click()
Text3.Text = UCase(Text3.Text)
End Sub
Private Sub Option2_Click()
Text3.Text = LCase(Text3.Text)
End Sub
Output:


Program 9:
Dim mark As Integer
Dim msg As String
Private Sub cmdclr_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub cmdresult_Click()
mark = Text3.Text
If mark >= 75 And mark <= 100 Then
msg = Text1.Text + "  has obtained Distinction in  " + Text2.Text + "."
Text4.Text = msg
ElseIf mark >= 65 And mark <= 74 Then
msg = Text1.Text + "has obtained first class in" + Text2.Text + "."
Text4.Text = msg
ElseIf mark >= 50 And mark < 64 Then
msg = Text1.Text + "has obtained second class in" + Text2.Text = "."
Text4.Text = msg
ElseIf mark > 35 And mark <= 49 Then
msg = Text1.Text + "has obtained pass mark in" + Text2.Text + "."
Text4.Text = msg
Else
Text4.Text = msg
msg = Text1.Text + "has failed in" + Text2.Text + "."
End If
End Sub
Output:











Program 10:
Private Sub Command1_Click()
If optagra.Value = True Then
MsgBox "Your Answer is Correct"
Else
MsgBox "Your is Wrong"
End If
End Sub
Private Sub Form_Load()
optagra.Value = False
optmumbai.Value = False
optnepal.Value = True
End Sub            
Output:

Program 11:
Private Sub Command1_Click()
If Option1.Value = True Then
msg = "Hello Mr." + Text1.Text + "Welcome to Techcorner Computer Education centre"
Text2.Text = msg
ElseIf Option2.Value = True Then
msg = "Hello Miss . " + Text1.Text + "Welcome to Tech Corner Computer Education centre"
Text2.Text = msg
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Output:

Program 12:
Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Text1.FontBold = True
Text1.FontItalic = True
Else
Text1.FontBold = False
Text1.FontItalic = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = vbChecked Then
Text1.FontBold = True
Else
Text1.FontBold = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = vbChecked Then
Text1.FontItalic = True
Else
Text1.FontItalic = False
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = vbChecked Then
Text1.FontUnderline = True
Else
Text1.FontUnderline = False
End If
End Sub
Private Sub Command1_Click()
Text1.Text = ""
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Me.WindowState = 2
End Sub
Private Sub Option1_Click()
Text1.ForeColor = vbRed
End Sub
Private Sub Option2_Click()
Text1.ForeColor = vbBlue
End Sub
Private Sub Option3_Click()
Text1.ForeColor = vbGreen
End Sub
Private Sub Option4_Click()
Text1.ForeColor = vbBlack
End Sub
Private Sub Option5_Click()
Text1.FontSize = 10
End Sub
Private Sub Option6_Click()
Text1.FontSize = 15
End Sub
Private Sub Option7_Click()
Text1.FontSize = 20
End Sub
Private Sub Option8_Click()
Text1.FontSize = 24
End Sub
Output:

 Program 13:
Private Sub Command1_Click()
MsgBox "Your Travel Starts From " + Combo1.Text + " End with " + Combo2.Text
End Sub
Private Sub Command2_Click()
End
End Sub
Output:







Saturday, January 12, 2013

Network

                                                        NETWORK
Network:

      A network is a group of two or more computer systems linked together.



Uses of Network:
  1.  To facilitate communication via email, video conferencing, instant messaging, etc.
  2. To enable multiple users to share a single hardware device like a printer or scanner
  3. To enable file sharing across the network
  4. To allow for the sharing of software or operating programs on remote systems
  5. To make information easier to access and maintain among network users
There are various types of Networks available it can be shown in below:

  •    LAN (Local Area Networks)
  •    WAN(Wide Area Networks)
  •    CAN(Campus Area Networks)
  •     MAN(Metropolitan Area Networks)
  •     HAN(Home Area Networks)
1.LAN (Local Area Networks)
     A local area network (LAN) is a computer network that in used to interconnect computers in a single room, rooms within a building or buildings on one site are called Local Area Network (LAN). LAN transmits data with a speed of several megabits per second (106 bits per second). The transmission medium is normally coaxial cables .
Major Characteristics of LAN :
  • Every computer has the potential to communicate with any other computers of the network
  • High degree of interconnection between computers
  • Easy physical connection of computers in a network
  • Inexpensive medium of data transmission
  • High data transmission rate

Advantages of LAN
  • The reliability of network is high because the failure of one computer in the network does not effect the functioning for other computers.
  • Addition of new computer to network is easy.
  • High rate of data transmission is possible.
  • Peripheral devices like magnetic disk and printer can be shared by other computers.
Disadvantages of LAN
If the communication line fails, the entire network system breaks down.
2. Campus Area Networks (CANs): 
   A campus area network (CAN) is a network of multiple interconnected local area networks (LAN) in a limited geographical area. A CAN is smaller than a wide area network (WAN) or metropolitan area network (MAN).A CAN is also known as a Corporate Area Network (CAN).

Advantages of CAN:
  • Cost-effective
  • Wireless, versus cable
  • Multidepartmental network access
  • Single shared Data Transfer Rate (DTR)
3.Home-Area Networks (HANs):
           A home-area network (HAN) connects in-home digital devices, such as PCs, mobile phones, entertainment technology, thermostats, home security systems and smart appliances, into a common network. 

Advantages of HAN
  • The main advantage of a network is that multiple users can simultaneously interact with each other and share resources for example the internet connection.
  • After the home network is created, as many wireless devices like laptops and mobile phones can connect to it *if it's a wireless router that is* and more PC's can also be connected with easy.
  • It is easy to create if known how to - we will be explaining at a later stage just how simple it is showing a step to step guide.
  • You can also add devices to the network like a printer. This will allow anyone with access rights to be able to print a file on any of the computers connected to the network.
Disadvantages of HAN
  • Buying all the equipment required *dependant on how many computers will be on the network* can be expensive
  • Complete set up of a network can be difficult and challenging for people who are computer illiterate
  • Depending on the network topology type, a broken cable can halt the whole network.
  • If the admin of the network doesn't know about securing the wireless on the router, anyone within range could be stealing the Internet connection and in result potentionally have access to personal data.
  • "Wireless includes the potential for radio interference due to weather, other wireless devices, or obstructions like walls".
4.Metropolitan Area Networks (MANs)
 A metropolitan area network (MAN) is a large computer network that usually spans a city or a large campus. A MAN usually interconnects a number of local area networks (LANs) using a high-capacity backbone technology, such as fiber-optical links, and provides up-link services to wide area networks (or WAN) and the Internet.
Advantages of MAN
  • Sharing of resources such as printers; hence cost effective. 
  • It can send local emails.
  • It connects all of your computers and servers together on the network , and is typically very fast.
5.Wide Area Networks (WANs)  
          A WAN consists of two or more local-area networks(LANs).Computers connected to a wide-area network are often connected through public networks, such as the telephone system. They can also be connected through leased lines or satellites. The largest WAN in existence is the Internet.


Advantages Of WAN

  • Covers a large geographical area so long distance businesses can connect on the one network.
  • Shares software and resources with connecting workstations.
  •  Messages can be sent very quickly to anyone else on the network. These messages can have pictures, sounds, or data included with them (called attachments).
  •  Expensive things (such as printers or phone lines to the internet) can be shared by all the computers on the network without having to buy a different peripheral for each computer.
  • Everyone on the network can use the same data. This avoids problems where some users may have older information than others.
  • Share information/files over a larger area.
  • Large network cover.



Disadvantages Of WAN
  •       Are expensive and generally slow.
  •       Need a good firewall to restrict outsiders from entering and disrupting the network.
  •       Setting up a network can be an expensive and complicated experience.
  •      The bigger the network the  more expensive it is.
  •      Protection against hackers and viruses adds more complexity and expense.
  •      Information may not meet local needs or interests.
  •      Vulnerable to hackers or other outside threats.
What is the difference between a LAN, a MAN, and a WAN?
            LAN: A LAN (local area network) is a group of computers and network devices connected together, usually within the same building. By definition, the connections must be high speed and relatively inexpensive.A LAN connection is a high-speed connection to a LAN. On the IUB campus, most connections are either Ethernet (10Mbps) or Fast Ethernet (100Mbps), and a few locations have Gigabit Ethernet (1000Mbps) connections.
         MAN: A MAN (metropolitan area network) is a larger network that usually spans several buildings in the same city or town. The IUB network is an example of a MAN.
        WAN: A WAN (wide area network), in comparison to a MAN, is not restricted to a geographical location, although it might be confined within the bounds of a state or country. A WAN connects several LANs, and may be limited to an enterprise (a corporation or an organization) or accessible to the public. The technology is high speed and relatively expensive. The Internet is an example of a worldwide public WAN.

Topology:
          Toplogy means  in communication networks, it is a usually schematic description of the arrangement of a network, including its nodes and connecting lines. There are two ways of defining network geometry: the physical topology and the logical (or signal) topology.


Physical Topology
        The physical topology of a network is the actual geometric layout of workstations.Graph Theory is used for studying network topology: nodes’ distance, interconnectivity, the rate of transmission and signal’s types of two networks might vary but their topologies could be identical.
The Physical Topologies are seven types.Namely,

  1. Point-to-Point topology,
  2. Bus (point-to-multipoint) topology,
  3. Ring topology,
  4. Star topology,
  5. Hybrid topology,
  6. Mesh topology and
  7. Tree topology. 
1.Point-to-Point Network Topology
              It is the basic model of typical telephony. The simplest topology is a permanent connection between two points. The value of a demanding point-to-point network is proportionate to the number of subscribers’ potential pairs. It is possible to establish a permanent circuit within many switched telecommunication systems: the telephone present in a lobby would always connect to the same port, no matter what number is being dialed. A switch connection would save the cost between two points where the resources could be released when no longer required.
2.Bus Network Topology
LANs that make use of bus topology  connects each node to a single cable. Some connector connects each computer or server to the bus cable. For avoiding the bouncing of signal a terminator is used at each end of the bus cable. The source transmits a signal that travels in both directions and passes all machines unless it finds the system with IP address, the intended recipient. The data is ignored in case the address is unmatched. The installation of one cable makes bus topology an inexpensive solution as compared to other topologies; however the maintenance cost is high. If the cable is broken all systems would collapse.
Linear Bus: If all network nodes are connected to a combine transmission medium that has two endpoints the Bus is Linear. The data transmitted between these nodes is transmitted over the combine medium and received by all nodes simultaneously.
Distributed Bus: If all network nodes are connected to a combine transmission medium that has more than two endpoints created by branching the main section of the transmitting medium.
3.Star Network Topology
            The topology when each network host is connected to a central hub in LAN is called Star. Each node is connected to the hub with a point-to-point connection. All traffic passes through the hub that serves as a repeater or signal booster. The easiest Star topology to install is hailed for its simplicity to add more nodes but criticized for making hub the single point of failure. The network could be BMA (broadcast multi-access) or NBMA (non-broadcast multi-access) depending on whether the signal is automatically propagated at the hub to all spokes or individually spokes with those who are addressed.


Extended Star: A network that keeps one or more than one repeaters between the central node or hub and the peripheral or the spoke node, supported by the transmitter power of the hub and beyond that supported by the standard of the physical layer of the network.
Distributed Star: The topology is based on the linear connectivity that is Daisy Chained with no top or centre level connection points.
4.Ring Network Topology
            Ring topology is one of the old ways of building computer network design and it is pretty much obsolete. FDDI, SONET or Token Ring technologies are used to build ring technology. It is not widely popular in terms of usability but incase if you find it any where it will mostly be in schools or office buildings.
Such physical setting sets up nodes in a circular manner where the data could travel in one direction where each device on the right serves as a repeater to strengthen the signal as it moves ahead.
5.Mesh Network Topology
        The exponent of the number of subscribers is proportionate to the value of the fully meshed networks.

Fully Connected: For practical networks such topology is too complex and costly but highly recommended or small number of interconnected nodes.
Partially Connected: This set up involves the connection of some nodes to more than one nodes in the network via point-to-point link. In such connection it is possible to take advantage of the redundancy without any complexity or expense of establishing a connection between each node.
6.Tree Network Topology

The top level of the hierarchy, the central root node is connected to some nodes that are a level low in the  hierarchy by a point-to-point link where the second level nodes that are already connected to central root would be connected to the nodes in the third level by a point-to-point link. The central root would be the only node having no higher node in the hierarchy. The tree hierarchy is symmetrical. The BRANCHING FACTOR is the fixed number of nodes connected to the next level in the hierarchy. Such network must have at least three levels. Physical Linear Tree Topology would be of a network whose Branching Factor is one.





7.Hybrid Topology:
A hybrid is a combination of two or more basic network topologies, such as a star-bus, star-ring, or tieredtopology. In a hybrid topology, central and distributed topologies are combined to meet the needs
an organization.







                   

Friday, January 11, 2013

Input and Output Devices


INPUT DEVICES
       A device that can be used to insert data into a computer or other computational device. Ex - Keyboard, Microphone etc. An input unit takes the input & converts it into binary form so that it can be understood by the computer. 
         
Input devices are various types it can be shown in below:
KEYBOARD
                This is most commonly used device which acts as input device. Its structure is like typewriter.It contains no. of  keys which have some specific ASCII values. Like ‘A’ has ASCII value 65. When this is pressed , it is converted into 65 & this 65 is sent to CPU in the form of Binary language (i.e. 1000001). Then operations are done on this data.


MOUSE
               This is a pointing device which contains a roller in its base. When the mouse is moved on any surface, the pointer on the screen is also moved. It contains a potentiometer coupled with the roller. This potentiometer senses the motion of mouse & convert it into digital value. A mouse may contain two or three buttons. 
BAR CODE READER
It is a device which is used to read the code from the products which are usually in the form of Bars. It contains a light sensitive detector which identifies the values of the bars on the product & converts them into numeric code.These Bar readers are used in Shopping malls in a very large scale.
DIGITAL CAMERA
As the name specifies, these camera stores the data digitally, which then can be stored in the computer & can be stored for a long time. But it has very limited storage capacity. These are very popular because of less expensive photographs & Speed.


LIGHT PEN
It is a pointing device which contains a photocell mounted at its tip. It senses the light from the screen when it becomes closer to the screen, & generates a pulse. So for identifying a particular location on the screen these light pens are very useful. But this is not in very much use these days.






SCANNER
The scanner is an input device like the photocopier machine which makes the electronic copy of the picture or document which can be further edited.

MIC's or MICROPHONES
The scanner is an input device like the photocopier machine which makes the electronic copy of the picture or document which can be further edited.


OUTPUT DEVICES
             The devices which are used to display the data to the user either in the form of hard copy or soft copy are called output devices.
Output devices are various types it can be shown in below:

SPEAKERS
Speakers receive the sound in the form of electric current from the sound card & convert it to sound format. These are used for listening music, chatting , seminars for presentations etc.



VDU (Visual Display Unit)
This is also called monitor. It is used to get the data in the form of soft copy. Their functioning is exactly similar to the television. It contains a CRT which emits the electrons to trace a regular pattern of horizontal lines on the screen.
PRINTER
These devices gives the hard copy of the output. These are in different types.
Impact - Have mechanical contact in between paper & printing head
Non Impact - No mechanical contact between paper & printing head
IMPACT :
Line Printers - print line wise (E.g. Drum Printer)
Character Printer - print character wise (E.g. Daisy Printer)
NON IMPACT -
Electromagnet Printers
Thermal Printers
Electrostatic Printers
Inkjet Printers
Laser Printers
LCD (Liquid Crystal Display)
These screens are used in laptops & notebook sized PCs. A special type of liquid is sandwiched between two plates. The top plate is clear & bottom plate is reflective. The molecules in these liquids are normally aligned & the computer signals are used to align these molecules.





























































Motherboard Indrouction


Amotherboard alternatively the mainboard, system board, planar board or logic board, colloquially, a mobo is a printed circuit board (PCB) found in all modern computers which holds many of the crucial components of the system, such as the central processing unit (CPU) and memory, and provides connectors for other peripherals.
Motherboard specifically refers to a PCB with expansion capability - the board is the "mother" of all components attached to it, which often include sound cards, video cards, network cards, hard drives or other forms of persistent storage, TV tuner cards, cards providing extra USB or Firewire slots, and a variety of other custom components. The term mainboard is applied to devices with a single board and no additional expansions or capability - in modern terms this would include controlling boards in televisions, washing machines and other embedded systems



Hardware:
          Computer hardware refers to the physical parts of a computer and related devices. Internal hardware devices include Mother Board and Ram.External hardware devices include Monitors, keyboards, mice, printers, and scanners.
The internal hardware parts of a computer are often referred to as Components, while external hardware devices are usually called peripheral.







Computer in Motherboard

Expansion of Computer:




Computer Means


C – Commonly
O – Operated
M – Machine
P  - Particularly
U – Used for
E – Educationa
R – Research