Friday, August 9, 2024

QBASIC Modular Programming

 

QBAISC Modular Programming

 

Write a program in QBASIC that asks two numbers to find sum of two numbers using SUB....END SUB program and difference of two numbers using FUNCTION...END FUNCTION.

                                                        

Write a program in QBASIC that asks three numbers to find average of three numbers using SUB....END SUB program and product of three numbers using FUNCTION...END FUNCTION.

 

Write a program in QBASIC that asks any number to find square of number using SUB....END SUB program and cube root of a number using FUNCTION...END FUNCTION.

 

Write a program in QBASIC that asks any number to find cube of a number using SUB....END SUB program and square root of a number using FUNCTION...END FUNCTION.

 

Write a program in QBASIC that asks two numbers to find sum of squares of two numbers using SUB....END SUB program and average of two numbers using FUNCTION...END FUNCTION.

 

Write a program in QBASIC that asks length, breadth of a room and calculate its area and perimeter. Create

a user defined function to calculate area and sub program to calculate perimeter.

[Hint: [Area=LxB], [p=2(L+B]]

 

Write a program in QBASIC that asks length and calculate its area and perimeter. Create

a user defined function to calculate area of square and sub program to calculate perimeter of square.

[Hint: [Area=L2], [p=4L]

 

Write a program in QBASIC that asks length, breadth and height of room and calculate its area and

volume. Create a user defined function to calculate area and sub-program to calculate volume. Hint:

[A=L×B], [V=L×B×H]

 

Write a program in Q-BASIC that asks length, breadth and height of cuboid and calculate its lateral surface area and Volume. Create a Function procedure to calculate lateral surface area and sub procedure to calculate volume.) [Hint:- LSA = 2h (l+b) and V=lxbxh]

 

Write a QBASIC program that asks length, breadth, height and calculate Volume of Cuboid and Total Surface Area. Create a USER DEFINED FINCTION to calculate Volume of Cuboid and SUB-PROGRAM to calculate Total Suface of Area. Hint: V=LxBxH, TSA=2(LB+LH+BH]

 

Write a program in QBASIC that ask the radius of circle. Write a program to calculate the area and

circumference of a circle. Create a user defined function first (r) to calculate area and sub procedure

second (r) to calculate circumference of a circle. Hint: [A=pr2], [C=2pr]

 

Write a program to calculate Area of circle using Function procedure and use SUB procedure to calculate its circumference in Q-Basic.[Hint: [A=pr2], [C=2pr]

 

Write a program in QBASIC that allows user to enter radius of a circle. Create a user define function to find

the area of circle and sub procedure to find volume of a cylinder. Hint: [A= pr2        v= pr2h]

 

Write a program to calculate total surface area of a cylinder using function procedure and volume using sub procedure. [Hint: Total surface area-2pr(h+r), Volume=pr2h]   [4]

 

Write a program in QBASIC to define a function procedure to display the area of sphere and sub procedure to display the volume of sphere where user need to input radius in main module.

[Hint: Area = 4*3.14*R^2, Volume = 4/3*3.14*R^3]

 

Write a program in QBASIC that asks radius of a circle and calculate its curved surface area and volume of hemisphere. Create a user - defined function to calculate volume of hemisphere and sub procedure to calculate curved surface area. [CSA=2pr2, Volume= 2/3pr3 ]                                   4

 

Write a program in QBASIC that asks radius of a circle and calculate its total surface area and volume of hemisphere. Create a user - defined function to calculate volume of hemisphere and sub procedure to calculate curved surface area. [TSA=3pr2, Volume= 2/3pr3 ]                                   4

 

Write a program in QBasic that ask the radius and height of a cylinder and calculate the volume and curve surface area. Create a user-defined function to calculate volume and sub-procedure to calculate curve surface area of a cylinder. [Hints: V=πr2h, CSA=2πrh]

 

Write a program in Qbasic to input a radius, create a user defined function to calculate the volume of hemisphere and total surface area of sphere using sub procedure. [V=2/3pr3 and TSA=4pr2]

 

Write a program in QBASIC that asks principal, time and rate of interest and calculate simple interest and amount. Create a user- defined function to calculate simple interest and sub-program to calculate amount. Hint: [S1=P*T*R/1001, (A=P+SI)

 

Write a program in QBASIC that allows the user to input length, breadth and height and then calculate the area of 4 walls. Hint: [A = 2H(L+B)]

 

Write a program in Q-Basic to find the perimeter of rectangle using Sub…END SUB procedure.

 

Using FUNCTION…..END FUNCTION, Write a program to calculate distance travelled by a body. [Hint: S=UT+1/2AT2]

 

Write a program suing Function to calculate area of triangle. [A=1/2*B*H]

 

Write a program in QBASIC that will asks the user to input length, breadth and height of a room then use SUB procedure calculate its volume and FUNCTION procedure to calculate its area of four walls.

 

Write a program to ask a number and display odd or even using FUNCTION procedure.

 

Write a program to ask a number and check whether the given number is divisible by 5 or not using sub procedure.

 

Write a program to ask a number and check whether the given number is multiple of 10 or not using function procedure.

 

Write a program to ask a number and check whether the given number is divisible by 3 and 7 or not using function procedure.

 

Write a program to check whether input number is negative, positive or zero using FUNCTION procedure.

 

Write a program to check whether input number is negative or positive using sub procedure.

 

Write a program in Q-Basic to find the largest among two numbers using FUNCTION procedure.

 

Write a program in Q-Basic to find the largest among three number using FUNCTION procedure and smallest using SUB procedure.

 

Write a program in Q-Basic to find the middle number among three number using FUNCTION procedure.

 

Write a program in QBASIC to ask a number and display sum of digits by using FUNCTION..END

FUNCTION. [4]

 

Write a SUB program to print series: 1,1, 2, 3, 5, 8, ........... up to 10th terms.             [4]

 

Write a program in QBASIC that allows user to enter a number and check whether the given number is prime or composite using sub procedure and check given number is even or odd using function procedure

WAP to calculate area of rectangle using SUB...END SUB and arca of circle using FUNCTION...END Function.

Write a program to define a sub procedure to display the reverse of string input by user. And define function procedure to find out volume of cylinder where the necessary data has to be fed in main module. [Hint volume of Cylinder=pR2H] [4]

No comments:

Post a Comment