MODULAR PROGRAMMING - FINAL REVISION - 4 MARKS
SEE COMPUTER SCIENCE 2082
1.
Write a program in QBASIC that asks the
user to enter the radius of a circle and calculates its area using a
FUNCTION and circumference using a SUB procedure. [A = πr², C = 2πr]
2.
Write a program in QBASIC that asks the
user to enter the radius of a circle and calculates its area using a
user-defined FUNCTION First(r) and circumference using a SUB procedure
Second(r). [A = πr², C = 2πr]
3.
Write a program in QBASIC that asks the
user to enter the length and breadth of a room and calculates its area
using a FUNCTION and perimeter using a SUB procedure. [A = L × B, P
= 2(L + B) ]
4.
Write a program in QBASIC that asks the
user to enter the length, breadth and height of a room and calculates
its area using a FUNCTION and volume using a SUB procedure.[A = L
× B, V = L × B × H]
5.
Write a program in QBASIC that asks the
user to enter the length, breadth and height of a room and calculates
its volume using a FUNCTION and area of four walls using a SUB
procedure.[V = L × B × H, A = 2H(L + B) ]
6.
Write a program in QBASIC that asks the
user to enter the radius and height of a cylinder and calculates its volume
using a FUNCTION and curved surface area using a SUB procedure.[V =
πr²h, C = 2πrh]
7.
Write a program in QBASIC that asks the
user to enter the radius and height of a cylinder and calculates its total
surface area using a FUNCTION and volume using a SUB procedure.[TSA
= 2πr(r + h), V = πr²h[
8.
Write a program in QBASIC that asks the
user to enter the radius of a circle and calculates the volume of a
cylinder using a FUNCTION and circumference of the circle using a SUB
procedure.[V = πr²h, C = 2πr]
9.
Write a program in QBASIC that asks the
user to enter the radius of a hemisphere and calculates its volume
using a FUNCTION and total surface area using a SUB procedure.[V =
(2/3)πr³, TSA = 3πr²]
10. Write
a program in QBASIC that asks the user to enter the radius of a
sphere and calculates its volume using a FUNCTION and total
surface area using a SUB procedure. [V = (4/3)πr³, TSA = 4πr²]
11. Write
a program in QBASIC that asks the user to enter principal, time and
rate of interest and calculates simple interest using a SUB procedure
and amount using a FUNCTION procedure.
[SI = (P × T × R) / 100, A = P + SI]
12. Write
a program in QBASIC that asks the user to enter three numbers and
displays the greatest number using a FUNCTION and smallest number
using a SUB procedure.
13. Write
a program in QBASIC that asks the user to enter two numbers and
finds the remainder using a SUB procedure and product using a
FUNCTION procedure.
14. Write
a program in QBASIC that calculates the area of a rectangle using a
user-defined FUNCTION and the area of a circle using a SUB procedure.[Area
of rectangle = LxB , Area of circle = πr²]
15. Write
a program in QBASIC that asks the user
to enter the three sides of a triangle
and calculates its area using a FUNCTION and
perimeter using a SUB procedure. [P=a+b+c, Area=
16. Write
a program in QBASIC that calculates the area of four walls using a
FUNCTION and the area of a rectangle using a SUB procedure. .[Area
of rectangle = LxB , Area of 4 walls = 2H(L + B)]
17. Write
a program in QBASIC that asks the user to enter any three different
numbers and finds their product using a user-defined FUNCTION PROD()
and average using a SUB procedure AVG().
18. Write
a program in QBASIC that asks the user to enter any number and
displays its cube using a SUB procedure and square root using a
FUNCTION.

No comments:
Post a Comment