كارگاه  VB

VERSION 5.00
Begin VB.Form Form1
   BackColor       =   &H8000000E&
   Caption         =   "P135-3"
   ClientHeight    =   3090
   ClientLeft      =   6765
   ClientTop       =   5430
   ClientWidth     =   4680
   BeginProperty Font
      Name            =   "MS Sans Serif"
      Size            =   12
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H8000000D&
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   Begin VB.CommandButton Command2
      Caption         =   "End"
      Height          =   495
      Left            =   3120
      TabIndex        =   1
      Top             =   2160
      Width           =   1215
   End
   Begin VB.CommandButton Command1
      Caption         =   "Run"
      Height          =   495
      Left            =   3120
      TabIndex        =   0
      Top             =   1440
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim inta, intb, intc As Integer
inta = InputBox("enter inta:")
intb = InputBox("enter intb:")
If intb <> 0 Then
    intc = inta \ intb
    Print " The result is : "; intc
Else
    Print " Not defined "
End If
End Sub

Private Sub Command2_Click()
End
End Sub

كارگاه  VB

VERSION 5.00
Begin VB.Form Form1
   BackColor       =   &H00C0C0FF&
   Caption         =   "p135-7"
   ClientHeight    =   4650
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7200
   LinkTopic       =   "Form1"
   ScaleHeight     =   4650
   ScaleWidth      =   7200
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text1
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   1200
      TabIndex        =   2
      Top             =   1200
      Width           =   3975
   End
   Begin VB.CommandButton Command2
      BackColor       =   &H000000FF&
      Caption         =   "End"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      MaskColor       =   &H00E0E0E0&
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CommandButton Command1
      BackColor       =   &H000000FF&
      Caption         =   "Get salary"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      MaskColor       =   &H00E0E0E0&
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   3240
      Width           =   1215
   End
   Begin VB.Label Label1
      BackColor       =   &H00C0C0FF&
      Caption         =   "Tax:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1080
      TabIndex        =   3
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim salary, tax As Single
salary = InputBox("enter the salary....")

Select Case salary
    Case Is < 0
        Text1.Text = "WRONG"
    Case Is < 200000
        Text1.Text = 0
    Case Is < 800000
        tax = (salary - 200000) * 0.1
        Text1.Text = Str(tax)
    Case Is > 800000
        tax = (salary - 800000) * 0.12
        Text1.Text = Str(tax)
        End Select
End Sub

Private Sub Command2_Click()

End
End Sub

كارگاه  VB

VERSION 5.00
Begin VB.Form Form1
   BackColor       =   &H00C0C0FF&
   Caption         =   "p135-7"
   ClientHeight    =   4650
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7200
   LinkTopic       =   "Form1"
   ScaleHeight     =   4650
   ScaleWidth      =   7200
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text1
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   1200
      TabIndex        =   2
      Top             =   1200
      Width           =   3975
   End
   Begin VB.CommandButton Command2
      BackColor       =   &H000000FF&
      Caption         =   "End"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      MaskColor       =   &H00E0E0E0&
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CommandButton Command1
      BackColor       =   &H000000FF&
      Caption         =   "Get salary"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      MaskColor       =   &H00E0E0E0&
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   3240
      Width           =   1215
   End
   Begin VB.Label Label1
      BackColor       =   &H00C0C0FF&
      Caption         =   "Tax:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1080
      TabIndex        =   3
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim salary, tax As Single
salary = InputBox("enter the salary....")

Select Case salary
    Case Is < 0
        Text1.Text = "WRONG"
    Case Is < 200000
        Text1.Text = 0
    Case Is < 800000
        tax = (salary - 200000) * 0.1
        Text1.Text = Str(tax)
    Case Is > 800000
        tax = (salary - 800000) * 0.12
        Text1.Text = Str(tax)
        End Select
End Sub

Private Sub Command2_Click()

End
End Sub

كارگاه  VB

VERSION 5.00
Begin VB.Form Form1
   Caption         =   "P135-4"
   ClientHeight    =   4170
   ClientLeft      =   6030
   ClientTop       =   4140
   ClientWidth     =   6855
   LinkTopic       =   "Form1"
   ScaleHeight     =   4170
   ScaleWidth      =   6855
   Begin VB.TextBox Text3
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1800
      TabIndex        =   4
      Top             =   1920
      Width           =   2055
   End
   Begin VB.TextBox Text2
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1800
      TabIndex        =   3
      Top             =   1200
      Width           =   2055
   End
   Begin VB.TextBox Text1
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1800
      TabIndex        =   2
      Top             =   480
      Width           =   2055
   End
   Begin VB.CommandButton Command2
      Caption         =   "Run"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      TabIndex        =   1
      Top             =   2760
      Width           =   1215
   End
   Begin VB.CommandButton Command1
      Caption         =   "End"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5520
      TabIndex        =   0
      Top             =   3360
      Width           =   1215
   End
   Begin VB.Label lbl
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   360
      TabIndex        =   8
      Top             =   3000
      Width           =   4815
   End
   Begin VB.Label Label3
      Caption         =   "Day:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   7
      Top             =   2040
      Width           =   975
   End
   Begin VB.Label Label2
      Caption         =   "Mount:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   6
      Top             =   1320
      Width           =   975
   End
   Begin VB.Label Label1
      Caption         =   "Year:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   5
      Top             =   600
      Width           =   975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim inta, intb, intc As Integer
Dim intm As Date

Private Sub Command1_Click()
inta = Val(Text1.Text)
If inta < 1300 Or inta > 1388 Then
    lbl.Caption = "Enter the year between 1300 to 1388"
End If

intb = Val(Text2.Text)
If intb < 1 Or intb > 12 Then
    lbl.Caption = "Enter the mount between 1 to 12"
End If

intc = Val(Text3.Text)
If intc < 1 Or intc > 31 Then
    lbl.Caption = "Enter the day between 1 to 31"
End If

End
End Sub

Private Sub Command2_Click()


'intyear = 1388 - inta
intm = Date
Print intm


End Sub

 

كارگاه  VB

VERSION 5.00
Begin VB.Form Form1
   Caption         =   "p135-5"
   ClientHeight    =   4875
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8025
   LinkTopic       =   "Form1"
   ScaleHeight     =   4875
   ScaleWidth      =   8025
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text5
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   6
      Top             =   3960
      Width           =   2775
   End
   Begin VB.TextBox Text4
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   5
      Top             =   3240
      Width           =   2775
   End
   Begin VB.TextBox Text3
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   4
      Top             =   2160
      Width           =   2775
   End
   Begin VB.TextBox Text2
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   3
      Top             =   1440
      Width           =   2775
   End
   Begin VB.TextBox Text1
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   2
      Top             =   720
      Width           =   2775
   End
   Begin VB.CommandButton Command2
      Caption         =   "roots"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6360
      TabIndex        =   1
      Top             =   3480
      Width           =   1215
   End
   Begin VB.CommandButton Command1
      Caption         =   "end"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6360
      TabIndex        =   0
      Top             =   4080
      Width           =   1215
   End
   Begin VB.Label lbl
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5040
      TabIndex        =   12
      Top             =   840
      Width           =   2535
   End
   Begin VB.Label Label5
      Alignment       =   2  'Center
      Caption         =   "root2"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   11
      Top             =   3960
      Width           =   855
   End
   Begin VB.Label Label4
      Alignment       =   2  'Center
      Caption         =   "root1:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   10
      Top             =   3240
      Width           =   855
   End
   Begin VB.Label Label3
      Alignment       =   2  'Center
      Caption         =   "c:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   9
      Top             =   2280
      Width           =   855
   End
   Begin VB.Label Label2
      Alignment       =   2  'Center
      Caption         =   "b:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   8
      Top             =   1560
      Width           =   855
   End
   Begin VB.Label Label1
      Alignment       =   2  'Center
      Caption         =   "a:"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   7
      Top             =   840
      Width           =   855
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
End

End Sub

Private Sub Command2_Click()
Dim a, b, c, r1, r2, delta As Single

a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)

If a = 0 Then
    lbl.Caption = "( a )is wrong!"
    Exit Sub
End If

delta = b ^ 2 - 4 * a * c
If delta < 0 Then lbl.Caption = " No Roots"

If delta = 0 Then
    lbl.Caption = " One Root"
    r1 = -b / (2 * a)
    Text1.Text = Str(r1)
    Text2.Text = Str(r1)
End If

If delta > 0 Then
    r1 = (-b + Sqr(delta)) / (2 * a)
    r2 = (-b + -Sqr(delta)) / (2 * a)
    Text4.Text = Str(r1)
    Text5.Text = Str(r2)
    lbl.Caption = " Two Roots"
 End If
End Sub