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

Friday, July 15, 2011

VB-43 : To determine whether a student is passed or not

Design a VB application to take input of 5 subjects marks,calculate the total,average and give the grade accordingly.

Refer Program to calculate a student's grade also.

A)    Program Design : 



(B) Property(Controls Used) :
  •      8 Labes and whose captions are Maths,Science,English,Computer,Social,Total,Average and Grade
  •       8 Text Boxes ( (1)The Text Property of the first 7 text boxes should be kept ZERO, and the 8th one is Blank... (2)The Index property of the first 5 text box have to give from ZERO to FOUR...  (3)The Locked property of the last 3 text boxes should be kept as True).

  Grade is calculated on the following basis.
   Fail                : IF (fail in any subject)
Passed             : Average mark is  <50 and >=40
Second Class  :Average mark is  <60 and >=50
First Class     : Average mark is  <70 and >=60
Distinction     : Average mark is  >=70


(C) Attaching Code to the Object :

Private Sub Text1_Change(Index As Integer)
cal_total
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
SendKeys (Chr(8))
End If
End Sub
Private Sub cal_total()
Dim i As Integer
Dim sum As Integer
Dim f As Boolean
f = False

For i = 0 To 4
sum = sum + Val(Text1(i).Text)
If Val(Text(i).Text) < 40 Then
f = True
End If
Next
Text6 = sum
Text7 = sum / 5
If f = True Then
Text8 = "Fail"
ElseIf Val(Text7) >= 70 Then
Text8 = "Distinction"
ElseIf Val(Text7) >= 60 Then
Text8 = "First Class"
ElseIf Val(Text7) >= 50 Then
Text8 = "Second Class"
Else
Text8 = "Pass"
End If
End Sub
Private Sub Text1_LostFocus()
If Val(Text1(Index).Text) > 100 Or Val(Text1(Index).Text) < 0 Then
MsgBox " Marks should be between 0 and 100,Please varify"
Text1(Index).SetFocus
End If
End Sub

====================================================================
===========================================================

VB-42 : Generate Bill for a Stationary Shop

Design a simple application to generate a bill for a stationary shop which sellsBooks,CDs,DVDs,Writing pads,Pens,Pencils and other stationary items.Assumptions can be made whereever necessary.

Refer
Generate a bill for a ready-made garment store



========================================================================== 
Back to Home   &  VB
========================================================================== 

VB-41 : Calculate future value of an investment

Compute FV(Future Value) of an investment.The formula used is as follows:

FV=Investment*(1+Interest )years
Also,design a splash screen for this application.Use appropriate controls to design the user interface.
A)    Program Design : 
    ( Design & Code  for Splash Screen didn't give)

(B) Property(Controls Used) :
  •      4 Labels and their CAPTIONS are Investment Amount(Rs.),nvestment Period(Years),Interest Rate and Future Value is .
  •    One Command Button and its CAPTION is Calculate Future Value.
  •     4 Text Boxes

(C) Attaching Code to the Object :


Private Sub Command1_Click()

Dim investment As Single
Dim rate As Single
Dim years As Integer
Dim FV As Single

investment = Val(Text1.Text)
rate = Val(Text3.Text)
years = Val(Text2.Text)
FV = investment * power((1 + rate / 100), years)
Text4.Text = FV
End Sub

Private Function power(base As Double, raise As Integer) As Double
power = 1
For i = 1 To raise
power = power * base
Next
End Function

      • ====================================================================
        Back to Home   &  VB
    ===========================================================