Computer Studies

Draw a flowchart and write a program in QBASIC to calculate the area and the perimeter of 10 different rectangles. Take the length and breadth as inputs and display the result.

QBASIC: For-Next Statements

27 Likes

Answer

Flowchart

Draw a flowchart and write a program in QBASIC to calculate the area and the perimeter of 10 different rectangles. Take the length and breadth as inputs and display the result. Class 7 ICSE Understanding Computer Studies

QBASIC Program

Cls
For I = 1 To 10
    Input "Enter length and breadth"; L, B
    A = L * B
    P = 2 * (L + B)
    Print "Area = "; A
    Print "Perimeter = "; P
Next I
End

Output

Enter length and breadth? 2,1
Area = 2
Perimeter = 6
Enter length and breadth? 2,3
Area = 6
Perimeter = 10
Enter length and breadth? 2,4
Area = 8
Perimeter = 12
Enter length and breadth? 3,4
Area = 12
Perimeter = 14
Enter length and breadth? 3,5
Area = 15
Perimeter = 16
Enter length and breadth? 3,6
Area = 18
Perimeter = 18
Enter length and breadth? 4,5
Area = 20
Perimeter = 18
Enter length and breadth? 5,8
Area = 40
Perimeter = 26
Enter length and breadth? 6,9
Area = 54
Perimeter = 30
Enter length and breadth? 7,8
Area = 56
Perimeter = 30

Answered By

13 Likes


Related Questions