' Mr. Minich Name - ' Period 1 ' Ch 3 Worksheet #1 ' 9/14/2000 ' Purpose - This program demonstrates the use of variables and declaration statements.
Option Explicit Private Sub Form_Activate()
' declaration statements ***************************************************** Dim strName As String ' name of runner Dim sngDistance As Single ' distance of the race Dim intHours As Integer ' hours run Dim intMinutes As Integer ' leftover minutes run Dim intTotalMinutes As Integer ' total minutes run Dim sngPace As Single ' running pace in mins/mile ' assignment statements ****************************************************** strName = "Bill Rodgers" sngDistance = 6.2 intHours = 0 intMinutes = 30 intTotalMinutes = intHours * 60 + intMinutes ' computing total minutes run sngPace = intTotalMinutes / sngDistance ' computing pace ' displaying the output ***************************************************** frmMain.Print "Welcome to the Running Calculator Program" frmMain.Print frmMain.Print "The great runner, Bill Rodgers, won his first " frmMain.Print "Boston Marathon in 1975 with a time of " frmMain.Print "approximately " & intHours & " hours and " & intMinutes & " mins." frmMain.Print frmMain.Print "Since a marathon is " & sngDistance & " miles, "; frmMain.Print "his average mile pace was " frmMain.Print sngPace & " mins/mile." End Sub ' 1. What displays as the final output on the screen? Draw a box on the back of this ' worksheet and show the EXACT output as accurately as possible. ' 2. Show the intermediate values of the following variables. ' strName sngDistance intHours intMinutes intTotalMinutes sngPace ' ------- ----------- -------- ---------- --------------- -------