CISY 125 - In-Class Lab 4
This lab has two parts. These are two separate programs.
Part A
Page 121 # 5 (Martha's Dance School)
Save your work to the In-Class lab floppy as INLAB04A.BAS
Your program could be as simple as one INPUT and one PRINT USING statement. I have provided
several runs so that you can test your program.
Sample run
Please enter the hours of instruction given the student? 1
Amount Due: 6.75
Sample run
Please enter the hours of instruction given the student? 2
Amount Due: 13.50
Sample run
Please enter the hours of instruction given the student? 10
Amount Due: 67.50
Sample run
Please enter the hours of instruction given the student? 100
Amount Due: 675.00
Before proceeding to Part B, make sure that you can display the Amount Due above
using the PRINT USING statement.
You may find it easier to diplay the literal "Amount Due" using a PRINT with a ; at the end
and then PRINT USING for the value of amount due
Part B
Page 121 # 2 (batting average)
Save your work to the In-Class lab floppy as INLAB04B.BAS
The formula for calculating the Batting Average is in the book
Sample run
Enter Batter's Name? Homer
Enter Times at Bat? 125
Enter Number of Walks? 4
Enter Number of Hits? 50
The Batting Average for Homer is 0.413
Sample run
Enter Batter's Name? Ruth
Enter Times at Bat? 2500
Enter Number of Walks? 25
Enter Number of Hits? 2200
The Batting Average for Ruth is 0.889
Sample run
Enter Batter's Name? Bart
Enter Times at Bat? 100
Enter Number of Walks? 5
Enter Number of Hits? 80
The Batting Average for Bart is 0.842
Submitting the program
- Submit the QBasic code electronically (either hand in the In-Class Floppy, or e-mail the QBasic code)
- Submit the QBasic code on paper.