QBASIC Question Set/ Old questions/ Modular Programming
**1) Calculate Room Area and Perimeter**
Write a QBASIC program that prompts the user for the length and breadth of a room. Calculate its area using the formula `Area = Length × Breadth`, and calculate the perimeter using the formula `Perimeter = 2 × (Length + Breadth)`. Create a user-defined function to compute the area and a sub-program to calculate the perimeter. (Hint: `Area = L × B`, `Perimeter = 2 × (L + B)`)
**2) Calculate Room Area and Volume**
Write a QBASIC program that takes a room's length, breadth, and height as input. Compute its area using the formula `Area = Length × Breadth` and its volume using the formula `Volume = Length × Breadth × Height`. Implement a user-defined function to calculate the area and a sub-program to determine the volume. (Hint: `Area = L × B`, `Volume = L × B × H`)
**3) Surface Area of Walls and Box**
Create a QBASIC program that takes the length, breadth, and height of an object. Calculate the surface area of its four walls using the formula `Surface Area = 2 × Height × (Length + Breadth)`, and compute the surface area of a box using the formula `Surface Area = 2 × (Length × Height + Breadth × Height + Length × Breadth)`. Develop a user-defined function for the walls' surface area and a sub-program for the box's surface area. (Hint: Walls' Surface Area = `2H × (L + B)`, Box's Surface Area = `2 × (LH + BH + LB)`)
**4) Circle Area and Cylinder Volume**
Craft a QBASIC program that allows the user to input the radius of a circle. Calculate the area of the circle using the formula `Area = π × Radius²` and find the volume of a cylinder using the formula `Volume = π × Radius² × Height`. Implement a user-defined function for the circle's area and a sub-procedure for the cylinder's volume. (Hint: Circle's Area = `π × r²`, Cylinder's Volume = `π × r² × h`)
**5) Function to Find Wall Area**
Write a QBASIC program to compute the area of four walls using user-defined FUNCTIONS. Calculate the total wall area using the formula `Total Wall Area = 2 × Height × (Length + Breadth)`. (Hint: Total Wall Area = `2H × (L + B)`)
**6) Circle Area and Circumference**
Develop a QBASIC program that requests the radius of a circle from the user. Calculate its circumference using the formula `Circumference = 2 × π × Radius` and find its area using the formula `Area = π × Radius²`. Create a user-defined function for the circle's area and a sub-program for the circumference. (Hint: Area = `r²`, Circumference = `2πr`)
**7) Square and Average**
Design a QBASIC program that takes two numbers as input. Calculate and display the square of each number using a SUB... END SUB program. Additionally, calculate and display the average of the two numbers using FUNCTION... END FUNCTION. (Hint: Square = `Number × Number`, Average = `(Number1 + Number2) / 2`)
Netra Koirala
Computer Science Educator
Passionate computer science educator and author. Provides free study notes, practical guides, and tutorials for Class 9, 10, 11, 12, and B.Sc CSIT students in Nepal. Years of teaching experience in computer science fundamentals.
LinkedIn ProfileRelated Posts
Loading related posts…
Computer Science notes, tutorials, MCQs, and educational resources for Nepal students. Covering Class 9, SEE preparation, Class 11, Class 12, SLC, programming, DBMS, networking, HTML, JavaScript, PHP, OOP and more.
Featured Post
Grade 10 Computer Science: Specification Grid & Model Questions
Specification Grid & Model Questions of Computer Science | Grade 10 📚 Examination Resource Specification Grid & M...