Saturday, October 1, 2022

QBASIC Modular Programming Questions Collections 2079 - SEE Computer Science 2079

 MODULAR PROGRAMMING

1.      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]]

2.      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.

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

4.      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.

5.      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] [MODEL SET 1]

6.      Write a program in QBASIC that will asks the user to input length, breadth and height. Create a user defined function to calculate surface area of four walls and write sub program to calculate surface area of box. [Hint: surface area of for walls=2H(L+B), surface area of box=lh+bh+lb

7.      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= r2        v= πr2h]

8.      Write a program to define a function procedure to display area of sphere and sub procedure to display volume of sphere where user has to input the required data in the main module. [Hint: Area of sphere: 4*PI*R^2, Volume- V = 4/3 * π * r³ 

9.      Write a program in QBASIC that asks two numbers to find square of two numbers using SUB procedure and average of two numbers using FUNCTION procedure.

10.   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)] [MODEL SET 2]

11.   Write a program to calculate the area of four walls using SUB…END SUB.

12.   Write a program in QBASIC to find the total surface area of a box using FUNCTION…END FUNCTION.

13.   Write a program to calculate and print the simple interest using FUNCTION procedure

14.   Write a program using FUNCTION…END FUNCTION to get temperature in celsius from the user and then print the temperature in fahrenheit. [SLC 2070 R]

15.   Write a program using FUNCTION…END FUNCTION, to find the area of triangle.

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

17.   Write a program using FUNCTION…END FUNCTION to find the average of any two numbers given by the user. [SLC 2066 S]

18.   Using FUNCTION…END FUNCTION Write a program to calculate the average of three numbers.

19.   Write a program to calculate the volume of a cylinder using FUNCTION….END FUNCTION

20.   Using FUNCTION….END FUNCTION, Write a program to calculate distance travelled by a body. [SLC 2065R]

21.   Write a program using SUB…END SUB to get radius of circle and then print its area.

22.   Write a program using FUNCTION module to calculate and print the volume of a box. [SLC 2066 R]

23.   Write a program using SUB…END SUB to get radius of a circle and then print its circumference. [SLC 2067 S]

24.   Using user defined function, write a program to input monthly income in parameter then computer annual tax to be paid. The tax rate is 15% if annual income is above Rs. 200000, otherwise tax rate is 1%.

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

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

27.   Write a program that asks any three numbers and displays the difference between the greatest and the smallest value among the 3 supplied numbers using FUNCTION procedure.

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

29.   Write a program to test whether the given number is positive or negative using SUB…..END SUB. [SEE MODEL 2065 ],

30.   Using SUB…END SUB Write a program to test whether the given number is completely divisible by 13 or not. [SLC 2067 R]

31.   Write a program to input three different numbers in the main module and then find the greatest number using SUB procedure.

32.   Write a program to input a year and display whether that year is a leap year or not. [divisible by 4 but not 100] using sub procedure.[Y MOD 4 = 0 AND Y MOD 100 <> 0 OR Y MOD 400 = 0]

33.   Write a sub program to find whether the given number is perfect square number or not.

34.   Using SUB…END SUB Write a program to print the following series 9,7,5,…1.

35.   Write a program using SUB…END SUB to print the series 1,1,2,3,5,8… upto ten terms.

36.   Write a program to print natural numbers from 1 to 5 using SUB…END SUB.

37.   Write a program using SUB…END SUB to print the first ten odd numbers.

38.   Write a program to print the sum of digits of a given number using SUB procedure.

39.   Write a program to generate the series using SUB …… END SUB : -10, -18, -6, -4, ………. Up to 20th term.

40.   Write a program using a SUB procedure module to print the multiplication table of any input number up to tenth termsWrite a program that asks any number and calculates its factors using a SUB procedure

41.   Write a program using FUNCTION…END FUNCTION, to get a word from the user and the print the word in reverse order.

42.   Write a program using SUB…END SUB to get a word from the user and then print it in reversed order. [SLC 2070 R], [SEE 2072]

43.   Write a program to declare SUB procedure to print only the vowels from a given word.

44.   Write a program to count the total number of vowels using FUNCTION…END FUNCTION. [SEE 2073]

45.   Write a program using FUNCTION…END FUNCTION to input a string and count the total number of consonants. [SLC 2071 R]

46.   WAP using FUNCTION procedure named extract (“Education”) to extract all the characters from the given string excluding the first and last characters only. The output of the given program is ducatio.

(Your program should not contain any if condition and looping statement.)

47.   Display the pattern using SUB procedure: (You can’t feed input as neither abcde nor in any cases given alphabets)

a

BB

ccc

DDDD

eeeee

48.   Write a program using FUNCTION... END FUNCTION to count the number of words in a sentence. [SEE 2074]

No comments:

Post a Comment