Monday, September 27, 2010

Pseudocode for calcBathRooms module

-For each module , use pdesudocode ( see Firgure 1.4 ) or a flowchart ( see Figure 1.5 ) to specify the steps to be followed ( algorithm ) in order to accomplish the task


Algorithm Calculation Bathrooms
1 prompt user and read linoleum price
2 Prompt user and read number of bathrooms
3 set total bath area and baths processed to zero
4 While (baths processed < number of bathrooms )
1 prompt user and read linoleum price
2 prompt user and read number of bathrooms
3 set total bath area and baths processed to zero
4 while ( baths processed < number of bathrooms )
1 Prompt user and read bath length and width
2 total bath area =
3 total bath area + bath length * bath width
4 add 1 to baths processed
5 bath cost = total bath area * linoleum price
6 return bath cost
end Algorithm Calculate BathRooms

No comments:

Post a Comment