2.1 volume = breadth*height*length
3.1 display the result
3) PROGRAM IN VISUAL BASIC
Sub Command1_Click()
assign_values
calculate_volume_of_cube
display_result
End Sub
Sub assign_values()
breadth_of_cube = InputBox("Key in the breadth_of_cube")
height_of_cube = InputBox("Key in the height_of_cube")
length_of_cube = InputBox("Key in the length_of_cube")
End Sub
Sub calculate_volume_of_cube()
volume_of_cube = breadth_of_cube * height_of_cube * length_of_cube
End Sub
Sub display_result()
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
Print volume_of_cube
End Sub
Sub Command2_Click()
End
End Sub
4) TEST DATA
5) DRY RUN TABLE
6) EVALUATION
Firstly, I created an Input/Process/Output table to decide what data would go where in order to help create the program quicker than if I had used no preparation and to avoid potential mistakes. Then, I wrote the program in pseudo code as a guide to what values to assign. I then wrote the program on A4 as a preparation to actually typing the program. I then created a Test Data table. This is a table of the variables which should be tested, a reason for the test and a value with which it should be tested.
After that, I created a Dry Run table which shows the expected results of the testing process. When all this had been done, I actually keyed in the program, tested it and completed the Dry Run table. Overall, I didn’t really encounter any problems because of all the preparation in 1 – 5 that had been made. If I had just keyed in the program from the top of my head with no tables or predictions, I almost certainly would have encountered a few problems.