Answer:
See below.
Step-by-step explanation:
Here's an algorithm to calculate the perimeter of a rectangular object with given length and breadth.
- Start
- Input the length of the rectangular object and assign it to a variable, say L.
- Input the breadth of the rectangular object and assign it to a variable, say B.
- Calculate the perimeter of the rectangular object using the formula: P = 2(L + B)
- Display the perimeter of the rectangular object.
- End
Here's the QBASIC program to implement the above algorithm.
CLS
INPUT "Enter the length of the rectangular object: ", L
INPUT "Enter the breadth of the rectangular object: ", B
P = 2 * (L + B)
PRINT "The perimeter of the rectangular object is: "; P
END
In this program, the INPUT statement is used to get the values of length and breadth from the user, which are then used to calculate the perimeter of the rectangular object using the formula mentioned in the algorithm. The PRINT statement is used to display the calculated perimeter.