Skip to main content

VB Program No: 9

         Create an application having 3 controls for entering principal amount,
rate or interest and years. Text box for principal amount should
accept numeric value not less than 5000. track bar for rate of interest
should have values between 5 to 8 having increment of 0.25 (default
value 6.5%) text box for years can have value in the range of 1 to 10
years (factions not allowed , default value 3) on pressing a button
calculate interest, simple interest should be calculated and SET –1n
the label with blue color and bold Arial font with size 24.

Public Class app7

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 56 Or Asc(e.KeyChar) = 46 Or Asc(e.KeyChar) = 8 Then
            e.Handled = False
        Else
            e.Handled = True

        End If
    End Sub

  
    Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
        If Val(TextBox1.Text) < 5000 Then
            MsgBox("Value should not be less then 5000", MsgBoxStyle.Exclamation)
            TextBox1.Clear()
            TextBox1.Focus()

        End If
    End Sub

  

    Private Sub TextBox2_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.GotFocus
        TextBox2.Clear()
    End Sub

    Private Sub TextBox2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.LostFocus
        If Val(TextBox2.Text) <= 0 Or TextBox2.Text > 10 Then
            MsgBox("Value should be between 1-10")
            TextBox2.Clear()
            TextBox2.Focus()


        End If
    End Sub
    Dim p, n As Integer
    Dim r As Double
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        p = Val(TextBox1.Text)
        n = Val(TextBox2.Text)
        r = TrackBar1.Value

        Label4.Text = (p * r * n) / 100
        Label4.Visible = True
    End Sub

End Class

Made By: Yadav Roshani R. from Third Year of BCA
 

Comments

Popular posts from this blog

Characteristics of a Good Programming Language

Till now there are many high level languages which are very popular, and there are others, which could not become so popular in-spite of being very powerful. There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important with respect to making a programming language good are briefly discussed below. Simplicity A good programming language must be simple and easy to learn and use. For example, BASIC is liked by many programmers only because of its simplicity. Thus, a good programming language should provide a programmer with a clear, simple and unified set of concepts which can be easily grasped. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple. However, the power needed for the language should not be sacrificed for simplicity. The overall simplicity of a programming language strongly affects the readability of the pr...

Angular 4 and Firebase Authentication: Setup

If you have come to this article, it means you are keen to learn new technology and that too Firebase. I love Firebase because it provides all basic but important features of any web application. Take for example, authentication, which is cumbersome and risky if not implemented with utmost care. And when we have the integration of Angular and Firebase, it becomes a lot easier for a developer to build such crucial modules in less time with minimal efforts. In this article we will create a simple Angular application using Firebase. I am going ahead with the understanding that you know the benefits of Firebase and have little knowledge about it. There are plenty of posts out on the web if you are behind. Step 1: Install Angular CLI (if not installed). npm install -g angular-cli Step 2: Create new Angular 4 project. By default now angular CLI will create Angular 4 project so you need not fret. ng new firebase-authentication Step 3: Check whether the ne...

Switch-case, simple calculator . . .

11.      Write a program to perform some mathematic functions with the help of “switch-case” statement. #include<stdio.h> #include<conio.h> void main() { int a,b,ans; char c; clrscr(); printf("\ Enter a and b:"); scanf("%d%d",&a,&b); printf("\n Enter operator:"); fflush(stdin); scanf("%c",&c); switch(c) { case'+':ans=a+b;       break; case'-':ans=a-b;       break; case'*':ans=a*b;       break; case'/':ans=a/b;       break; } printf("\n ans %d",ans); getch(); } 12.      Print the Fibonacci series #include<stdio.h> #include<conio.h> void main() { int a=1,b=1,s=3,c,ch; clrscr(); printf("how many steps="); scanf("%d",&ch); printf("%5d%5d",a,b); for(s=3;s<=ch;s++) {       c=a+b;       printf("%5d",c);       a=b;    ...