home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH3 / 3-6-4.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-17  |  2.5 KB  |  85 lines

  1. VERSION 5.00
  2. Begin VB.Form frm3_6_4 
  3.    Caption         =   "3-6-4"
  4.    ClientHeight    =   1890
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   2295
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1890
  20.    ScaleWidth      =   2295
  21.    Begin VB.PictureBox picResult 
  22.       Height          =   495
  23.       Left            =   120
  24.       ScaleHeight     =   435
  25.       ScaleWidth      =   1995
  26.       TabIndex        =   5
  27.       Top             =   1320
  28.       Width           =   2055
  29.    End
  30.    Begin VB.CommandButton cmdDivide 
  31.       Caption         =   "Do Long Division"
  32.       Height          =   375
  33.       Left            =   120
  34.       TabIndex        =   4
  35.       Top             =   840
  36.       Width           =   2055
  37.    End
  38.    Begin VB.TextBox txtDividend 
  39.       Height          =   285
  40.       Left            =   960
  41.       TabIndex        =   3
  42.       Top             =   480
  43.       Width           =   1215
  44.    End
  45.    Begin VB.TextBox txtDivisor 
  46.       Height          =   285
  47.       Left            =   960
  48.       TabIndex        =   1
  49.       Top             =   120
  50.       Width           =   1215
  51.    End
  52.    Begin VB.Label lblDividend 
  53.       Caption         =   "Dividend:"
  54.       Height          =   255
  55.       Left            =   120
  56.       TabIndex        =   2
  57.       Top             =   480
  58.       Width           =   855
  59.    End
  60.    Begin VB.Label lblDivisor 
  61.       Caption         =   "Divisor:"
  62.       Height          =   255
  63.       Left            =   240
  64.       TabIndex        =   0
  65.       Top             =   120
  66.       Width           =   735
  67.    End
  68. Attribute VB_Name = "frm3_6_4"
  69. Attribute VB_GlobalNameSpace = False
  70. Attribute VB_Creatable = False
  71. Attribute VB_PredeclaredId = True
  72. Attribute VB_Exposed = False
  73. Private Sub cmdDivide_Click()
  74.   Dim divisor As Single, dividend As Single
  75.   Dim quotient As Single, remainder As Single
  76.   'Long division
  77.   picResult.Cls
  78.   divisor = Val(txtDivisor.Text)
  79.   dividend = Val(txtDividend.Text)
  80.   quotient = Int(dividend / divisor)
  81.   remainder = dividend - Int(dividend / divisor) * divisor
  82.   picResult.Print "The quotient is"; quotient
  83.   picResult.Print "The remainder is"; remainder
  84. End Sub
  85.