Sunteți pe pagina 1din 6

PAGE 20 [Q1 & Q2] 1. A pseudo code that converts the distance in mile to kilometre is given as in Algorithm 2.3.

Usinf the Microsoft Word software, develop this pseudo code according to the steps explained in the first concept. Algorithm 2.3: Convert the distance in mile to kilometer 1. 2. 3. 4. Start Set KM_PER_MILE to 1.609 Set Distance_Mile to 100 Convert the distance in mile to kilometres using the formula: Distance_Kilo = KM_PER_MILE x Distance_Mile 5. Display the distance in kilometer 6. End

2. Algorithm 2.4 is pseudo code that reads the radius of a circle, and computes the area of that circle. Using the Microsoft Word software, develop this pseudo code. Algorithm 2.4 : Compute the area of circle the area of a circle 1. 2. 3. 4. Start Set PI = 3.14159 Read the Radius Calculate the area of acircle using the formula: Area = Radius x Radius x PI 5. Display Area 6. End

PAGE 27 & 28 [EXERCISE 3 : Q1,Q2,Q3 & Q4] Given the following set of problems. Analyze each problem and identify the input, fomula and the output. Write the psedo code and draw the for each.

1. Read three numbers. Calculate the sum of those three numbers and find the average. Display all three numbers, as well as the total of those numbers an the in average. Output: average the numbers of three numbers Input: the three numbers are given Formula: Average = Sum total of number divide total number of number Pseudocode design of the problem: Start Read three numbers Calculate the average using formula Average = Sum total of number divide total number of numbers Print the Average of numbers End Flowchart design of the problem:

Start

Read three numbers

Calculate the average using formula Average= sum total of number divide total number of numbers

Print the Average of numbers

End

2. Calculate the average weight of four students. Attempt to analyze this problem by sating its input, output and the formula required to determine the average weight. Display each students weight calculated. Output: Average weight of student Input: a)weight of student b) number of student Formula: Pseudocode design of the problem: Start Read weight of student calculate the average using formula :

Show the Average weight End Flowchart design of the problem:

Start

Read weight of student

Calculate the average using fomula:


Show the Average weight

End

3. Convert the time entered by the user in the form of day, hours and minute to minutes. The conversion unit is as follows : 1 day is equivalent to 24 hours 1 hours is equivalent to 60 minutes Output: Input: Formula: Pseudocode design of the problem: Flowchart design of the problem:

4. Convert the temperature entered by the user in the unit of Fahrenheit to the unit of Celcius. The conversion formula is as follows : Fahrenheit =[ Output: value Fahrenheit Input: value of Celcius Formula: Fahrenheit =[

Pseudocode design of the problem: Start Keyin the value of Celcius Calculate the value of Fahrenheit use Formula:
Fahrenheit =[ ]

Display the Value Fahrenheit End Flowchart design of the problem:

Start

Keyin the value of Celcius

Calculate the value of Fahrenheit use Formula:


Fahrenheit =[ ]

Display the Value Fahrenheit

End

PAGE 26 [EXERCISE 2 : Q2]

1. Trace the content of the variables and determine the output of Algorithm 2.4 if the input for Radius is : a. 3 b. 10 c. 150

S-ar putea să vă placă și