Designing and Writing a Program
Member rating: No Rating | Words: | Submitted: Mon Aug 18 2003
On the left is an image preview of every page of this document, and below are the first 150 words with formatting removed:
Task - Designing and Writing a Program Problem Input Process Output Breadth Height Length Breadth*Height*Length=Volume Volume Write a program to calculate the volume of a cuboid. The program should assign values for the length, height and breadth and the result should be displayed on the screen ten times. 1) INPUT, PROCESS, OUTPUT TABLE 2) PROGRAM IN PSEUDO CODE Level 1 1. assign the values 2. calculate the volume 3. display the result Level 2 1.1 assign a value to the variable breadth 1.2 assign a value to the variable height 1.3 assign a value to the variable length 1.4 assign a value to the variable volume 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...


