Cambridge IGCSE Programming Book
‘Calculate Volume and store in local variable Volume = Height1 * Width1 * Depth1 ‘Convert the value in volume current in cubic centimetres to litres Volume = Volume / Litres ‘Display the value held in the variable Volume Console.WriteLine(“The volume is”) Console.WriteLine(Volume) Console.ReadKey() End Sub End Module
Using the Windows Form application the interface could look something like Figure 3.06.
28
Figure 3.06 Interface design for Windows Forms Aquarium algorithm
Remember to give the design elements of the form appropriate names. Figure 3.06 shows the names in green. The Windows Form application code to achieve this solution should be run under the button click event: