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.
Answer
Flowchart
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
Related Questions
Draw a flowchart and write a program in QBASIC to display 10 different values of the expression (a + b)2. Take the values of a and b as inputs after each iteration.
Draw a flowchart and write a program in QBASIC to display the sum of the first 10 terms of the series S = 1 + 2 + 4 + 8 + …….
A class teacher wants to calculate the average marks obtained by a student in three terms in a class of 50 students. Draw a flowchart and write a program in QBASIC to enter the name and the total marks obtained by a student in three terms. Display the result along with the name.
Draw a flowchart and write a program in QBASIC to enter the name and marks secured in 12 subjects in a term examination. Display the name, total and the average marks.