Students and Teachers Forum
Modem stand for Modulator Demodulator. It is a network device that transfers data from one computer to another trough telephone line. A modem can convert digital signals into analog signals and vice versa. The conversion of digital signal into .....
Gateway is a dedicated server that connects two networks having dissimilar communication protocols. The gateway computer accepts the data packets from a network and forward to destination .....
A repeater is a network device that amplifies the incoming signals, creates a new copy of it and transmits the signals on the network. As the cabling distance the electric signals become weak on the network, in such a case a repeater is used to .....
A router is a network device that amplifies the incoming signals, creates a new copy of it and transmits the signals on the network. As the cabling distance the electric signals become weak on the network, in such a case a repeater is used to .....
A bridge is a network device that connects the different network segments or different network having same protocol. Multiple bridges can be used to form a large network by connecting several small networks. It also filters the data or cheeks .....
A switch is a networking device that has multiple connecting ports like hub. It is used to connect computers, network devices and network segments. A switch can determine source and destination of the data packets. It does not transmit the data .....
A hub is a network devices having multiple connecting ports or pints. It is used to connect computers or other network devices through its ports. It acts as a central point for different computers and other devices. Hub is mostly used in the .....
A client is a network computer that utilizes the resources of other network computers, including other clients. The client computer has its own processor, memory and storage and can maintain some of its resources and perform its own tasks and .....
The bandwidth defines the amount of data transmitted per second through the communication channel or the data handling capacity of a communication .....
Protocols are set of rules or language that the computer uses on the network to communicate and exchange data with each other. The network protocol manages and controls how communication between computers on the network takes place.The common .....
The star topology is the most popular network topology used to connect computers and other network devices in which nodes are connected to a centrally-located device called hub in the form of star. The advantages of star topology are as follows: If .....
The topology in which nodes are connected in a daisy chain by a linear sequence of buses which is formed by joining many segments of coaxial cables with BNC jacks and T-connectors is known as bus topology. The disadvantages of bus topology are as .....
The network topology is the cabling pattern of interconnection of computers on the network. It can be defined as the physical layout of cabling for connecting computers and other network devices on the network which describe how the computers and .....
A router is a network device that amplifies the incoming signals, creates a new copy of it and transmits the signals on the network. As the cabling distance the electric signals become weak on the network, in such a case a repeater is used to .....
A bridge is a network device that connects the different network segments or different network having same protocol. Multiple bridges can be used to form a large network by connecting several small networks. It also filters the data or cheeks .....
A switch is a networking device that has multiple connecting ports like hub. It is used to connect computers, network devices and network segments. A switch can determine source and destination of the data packets. It does not transmit the data .....
A hub is a network devices having multiple connecting ports or pints. It is used to connect computers or other network devices through its ports. It acts as a central point for different computers and other devices. Hub is mostly used in the .....
A client is a network computer that utilizes the resources of other network computers, including other clients. The client computer has its own processor, memory and storage and can maintain some of its resources and perform its own tasks and .....
The bandwidth defines the amount of data transmitted per second through the communication channel or the data handling capacity of a communication .....
Protocols are set of rules or language that the computer uses on the network to communicate and exchange data with each other. The network protocol manages and controls how communication between computers on the network takes place.The common .....
that is command,operator,machine,processing,user,transfer,electonic, .....
they are of three types:
1. registered
2. private
3. .....
Multistation Access .....
Terminal is a specialized network device on a host-based network that transmits the data entered by the user to the host for processing and displays the .....
The most powerful computer on the network, which does all the processing for the user is known as host .....
An UTP cable is one of the most popular LAN cables. This cable consists of 4 twisted pairs of metal wires(that means there are 8 wires in the cable). RJ45 connectors are used in UTP .....
A type of wire that consists of a center wire surrounded by insulation and then a grounded shield of braided wire. The shield minimizes electrical and radio frequency interface. Coaxial cabling is the primary type of cabling used by the cable .....
An optical fiber cable is a cable containing one or more optical fibers. The optical fiber elements are typically individually coated with plastics layers and contained in a protective tube suitable for the environment where the cable will be .....
The full form of STP is Shielded Twisted Pair.
.....
The full form of UTP is Unshielded Twisted Pair.
.....
Unguided transmission media is such a media where information is transmitted by sending electromagnetic signals through free space, as the signals are not guided in any specific direction or inside any specific medium.
Any three unguided .....
Guided transmission media is such a transmission media where signals are transmitted along a specific path through cable.
Any three guided transmission media are as follows:
Coaxial Cable
Twisted Pair Cable
Fiber Optical Cable .....
A communication media is the path through which data, information and files transfers from one computer to other computer in the form of electromagnetic wave i.e. electric signals.
The main two communication media are as follows:
Guided .....
Switch Bridge
Packet forwarding in Switches are performed using ASICs (Application Specific Integrated Circuits). Packet forwarding in Bridges are performed using software.
Work at higher speed. Work at lower speed.
Switches have more ports. .....
A communication protocol is a set of rules by which computers on the network communicate with each other.
Any four protocols used on the networks are as follows:
FTP ( File Transfer Protocol)
TCP/IP (Transmission Control Protocol/ .....
The disadvantages of computer network are:
Data and information may be stolen by computer hackers if the security of network is not reliable.
If any computer in a network gets affected by computer virus, there is high chance of spreading .....
Computer Networks can allow businesses to reduce expenses and improve efficiency by sharing data and common equipment, such as printers, among many different computers. At the same time, the network may be connected through cables, telephone lines, .....
Computer network is a group of interconnected computers through transmission media in order to communicate and share resources like hardware, data and software.
Any three advantages of computer network are:
Data and software of computer .....
There are three modes for transferring data from one device to another. They are:
Simplex
In simplex, the communication can takes place in only one direction. The simplex device can send only or receive data only. The transmission of data .....
The communication i.e. transferring of data and information over significant distances is known as telecommunication. .....
The data and information produced by the computer may need to transfer to other computers. The process of transferring data or information between computers is known as data communication. .....
OPEN" Employee.dat" FOR INPUT AS #1CLSDO WHILE NOT EOF ( 1)INPUT #1,N$,D$,P$,SIf S>= 5000 AND S<= 1000 THENPRINT N$,D$,P$,SEND .....
OPEN"student.dat"FOR APPEND AS #1CLSTOP:INPUT"Enter your name";N$INPUT" Enter your marks in English";EINPUT"Enter your marks in Nepali";NINPUT"Enter your marks in Computer";CWRITE#1,N$,E,N,CINPUT"To add more records (Y/N)";A$IF A$="Y" THEN GOTO .....
OPEN"Std.dat" FOR INPUT AS #1CLSDO WHILE NOT EOF(1)INPUT#1,N$,C,R,PRINT .....
OPEN"STD.dat" FOR OUTPUT AS #1CLSTOP:INPUT" Enter your name";N$INPUT"Enter your address";Ad$INPUT"Enter your telephone number"; TWRITE #1,N$,Ad$,TINPUT"Do you want to add more records (Y/N)";A$IF A$="Y" THEN GOTO TOP:CLOSE .....
OPEN"Library.dat" FOR OUTPUT AS #1CLSINPUT"Enter book number";BINPUT"Enter book name";A$WRITE #1,B,A$CLOSE .....
A sequential access data file is a file that should be accessed in a sequential manner starting at the beginning of the data block and process ending in order until and end of data.
.....
A file that contains a set of instructions that are needed for data processing is known as program and file that contains only data required during data processing is known as data file. .....
REM fibonacci series 0,1,1,2,3,5,....,10th terms
DECLARE SUB fibo(m,n)
CLS
a = 0
b = 1
PRINT a; b;
CALL fibo(a, b)
END
SUB fibo (a, b)
FOR i = 1 TO 8
c = a + b
PRINT c;
SWAP a, b
SWAP b, c
NEXT i
END .....
50. Assignment for class IX
WAP to enter any number and display
1. Sum of digits.
2. Sum of even digits.
3. Sum of odd digits.
4. Sum of square of digits.
5. Sum of cube of digits.
6. Sum of square of even digits.
7. Sum of square of odd digits.
8. Sum of cube of even digits.
9. Sum of cube of odd digits.
10. Even digits.
11. Odd digits.
Assignment for class IX
WAP to display
1. J
JA
JAG
JAGA
JAGAT
2. T
AT
GAT
AGAT
JAGAT
3. JAGAT
JAGA
JAG
JA
J
4. JAGAT
AGAT
GAT
AT
T
5. J
A
G
A
T
6. T
A
G
A
J
7. JAGAT
AGA
G
8. G
AGA
JAGAT
9. *
**
***
****
*****
10. *****
****
***
**
*
CLASS VIII PROJECT WORK FOR MID TERMINAL EXAMINATION 2070
1. INPUT ANY TWO NUMBERS AND DISPLAY THE GREATER NUMBER.
2. INPUT ANY TWO NUMBERS AND DISPLAY THE SMALLER NUMBER.
3. INPUT ANY THREE NUMBERS AND DISPLAY THE GREATEST NUMBER.
4. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS ODD OR EVEN.
5. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS POSITIVE OR NEGATIVE.
6. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS POSITIVE, NEGATIVE OR ZERO.
7. INPUT A MARK IN A SUBJECT OF A STUDENT AND CHECK IF THE STUDENT IS PASS Or NOT.(PASS MARK=40]
8. INPUT ANY THREE NUMBERS AND DISPLAY THE SMALLEST NUMBER.
9 CONVERT VALUE OF INDIAN CURRENCY INTO NEPALESE CURRENCY.
10. CONVERT VALUE OF NEPALESE CURRENCY INTO INDIAN CURRENCY.
11CONVERT VALUE OF NEPALSESE CURRENCY INTO DOLLAR.
. 12. CONVERT VALUE OF DOLLAR INTO NEPALESE CURRENCY.
13. CALCULATE PERIMITER OF RECTANGLE. [P=2(L+B)]
14. CALCULATE PERIMITER OF SQUARE. [P=4L]
15. CALCULATE CIRCUMFERENCE OF CIRCLE. [C=2PR]
CLASS : TEN PART II [QBASIC PROGRAM COLLECTIONS]
WAP USING SUB AND FUNCTION PROCEDURE
1. INPUT LENGTH IN KILOMETER AND CONVERT INTO METERS.
2. INPUT LENGTH IN METER AND CONVERT INTO KILOMETER AND METER.
3. CONVERT ENTERED NUMBER OF DAYS INTO YEARS, MONTHS AND DAYS.
4. TO DIVIDE A NUMBER BY ANOTHER NUMBER AND FIND THE QUOTIENT AND REMAINDER.
5. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS COMPLETELY DIVISIBLE BY 5 OR NOT.
6. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS COMPLETELY DIVISIBLE BY 3 AND 7 OR NOT.
7. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS EXACTLY DIVISIBLE BY 5 BUT NOT BY 11.
8. INPUT ANY TWO NUMBERS AND DISPLAY THE GREATER NUMBER.
9. INPUT ANY TWO NUMBERS AND DISPLAY THE SMALLER NUMBER.
10. INPUT ANY THREE NUMBERS AND DISPLAY THE GREATEST NUMBER.
11. INPUT ANY THREE NUMBERS AND DISPLAY THE SMALLEST NUMBER.
12. INPUT ANY THREE NUMBERS AND DISPLAY THE MIDDLE NUMBER.
13. INPUT ANY TWO NUMBERS AND DISPLAY THE GREATER AND SMALLER NUMBER.
14. INPUT ANY THREE NUMBERS AND DISPLAY THE GREATEST AND SMALLEST NUMBER.
15. INPUT ANY THREE NUMBERS AND DISPLAY THE GREATEST, SMALLEST AND THE MIDDLE NUMBER.
16. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS ODD OR EVEN.
17. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS POSITIVE OR NEGATIVE.
18. INPUT ANY NUMBER AND CHECK WHETHER THE GIVEN NUMBER IS POSITIVE, NEGATIVE OR ZERO.
19. INPUT A MARK IN A SUBJECT OF A STUDENT AND CHECK IF THE STUDENT IS PASS OT NOT.(PASS MARK=40]
20. INPUT AGE OF A PERSON AND FIND OUT WHETHER THE PERSON IS ELIGIBLE FOR DRIVING OR NOT. [AGE>=16]
21. INPUT A YEAR AND DETERMINE WHETHER IT IS A LEAP YEAR OR NOT.(DIVISIBLE BY 4 BUT NOT BY 11)
22. INPUT PERCENTAGE OF A STUDENT AND STUDENTS GETS A DIVISION AS PER THE FOLLOWING RULES:
PERCENTAGE GREATER OR EQUAL TO 80 DISTINCTION.
PERCENTAGE BETWEEN 60 TO 79 FIRST DIVISION
PERCENTAGE BETWEEN 50 TO 59 SECOND DIVISION
PERCENTAGE BETWEEN 40 TO 49 THIRD DIVISION
PRECENTAGE LESS THAN 40 FAIL
23. THE MARKS OBTAINED BY A STUDENT IN 8 DIFFERENT SUBJECTS ARE ENTERED THROUGH THE KEYBOARD. THE STUDENTS GETS A DIVISION AS PER THE FOLLOWING RULES:
PERCENTAGE GREATER OR EQUAL TO 80 DISTINCTION.
PERCENTAGE BETWEEN 60 TO 79 FIRST DIVISION
PERCENTAGE BETWEEN 50 TO 59 SECOND DIVISION
PERCENTAGE BETWEEN 40 TO 49 THIRD DIVISION
PRECENTAGE LESS THAN 40 FAIL
MARK LESS THAN 40 IN A SUBJECT WILL ALSO BE CONSIDERED AS FAIL
24. A COMPANY MANUFACTURES THREE PRODUCTS. IT GIVES A DISCOUNT OF 15% FOR THE FIRST ITEM, 10% FOR THE SECOND ITEM AND 5% FOR THE THIRD ITEM. IF THE TOTAL PURCHASE AFTER DEDUCTION EXCEEDS 1 LAKH, THEN A SPECIAL DISCOUNT OF 1 % IS GIVEN. CALCULATE THE NET COST AFTER DEDUCTION.
25. READ ANNUAL SALARY OF AN EMPLOYEE AND DECIDE TAX WITHHELD AS FOLLOWS:
SALARY TAX
UPTO 1,00,000/- 0%
UPTO 1,50,000/- 15%
ABOVE 1,50,000/- 25%
Set A Qbasic Programming Questions
WAP using sub to
1. Accept any two numbers and display its sum.
2. Accept any two numbers and display its product.
3. Accept any two numbers and display its average.
4. Accept any three numbers and display its sum, product and average.
5. Accept any three numbers and display the sum of square of numbers.
6. Accept any two numbers and display the sum of cube of numbers.
7. Accept any number and display its cube root.
8. Accept any number and display its cube root and square root.
9. Accept selling price and cost price and display profit.
10. Accept selling price and cost price and display loss percentage.
Set B Qbasic Programming Question Collections
WAP using function procedure to
1. Accept any three numbers and display its sum.
2. Accept any three numbers and display its product.
3. Accept any three numbers and display its average.
4. Accept any two numbers and display its sum, difference, product and average.
5. Accept any two numbers and display the sum of square of numbers.
6. Accept any three numbers and display the sum of cube of numbers.
7. Accept any number and display its square root.
8. Accept any number and display its cube root and square root.
9. Accept selling price and cost price and display loss.
10. Accept selling price and cost price and display profit percentage.
SET C Qbasic Program Collections
WAP USING SUB AND FUNCTION PROCEDURE
1. Display area and circumference of circle.
2. Display area of triangle.
3. Display total surface area and volume of sphere.
4. Display total surface area and volume of cylinder.
5. Display total surface area and volume of cube.
6. Find cost of painting the four walls of a room.
7. to accept temperature in Fahrenheit from user and convert into the Celsius.
8. To accept currency value in dollar and convert into Nepalese Rupees
9. Input days and convert into years, months and days.
10. Calculate distance.[S=UT+1/2(AT2)]
SET D Qbasic Programming Collections
WAP USING SUB AND FUNCTION PROCEDURE
1. Display area and perimeter of square.
2. Display area of 4 walls.
3. Display total surface area and volume of hemisphere.
4. Display total surface area and volume of cubic.
5. Display simple interest
6. To accept temperature in Celsius from user and convert into the Fahrenheit.
7. Input number as paisa and convert into rupees only.
8. Input seconds and convert into hours minutes and seconds.
9. Solve a quadratic equation ax2+bx+c=0 on the basis of the coefficient values a, b, and c.
10. Input distance in kilometer and convert into meter.
SET E Qbasic Programming Questions
1. WAP to input any number and check whether the given no. is divisible by 5 or not.
2. WAP to input any number and check whether the given no. is divisible by 3 and 7 or not.
3. WAP to input any number and check whether the given no. is positive, negative or zero.
4. WAP to input a year and display whether that year is a leap year or not. [divisible by 4 but not 100]
5. WAP to input any number and display whether it is odd or even.
6. To divide a number by another number and find the quotient and remainder.
7. WAP to input any number and check whether the given no. is positive or negative.
8. Input a mark in a subject of a student and check if the student is pass or nor. [Pass Mark >=40]
9. Input the age of a person and find out whether the person is eligible to drive or not. [age >=16]
10. Input the age of a person and find out whether the person is eligible to vote or not. [age >=18]
11. WAP to enter any two numbers and display the greater one.
12. WAP to enter any two numbers and display the smaller one.
13. WAP to enter any three numbers and display the greatest one.
14. WAP to enter any three numbers and display the smallest one.
15. WAP to enter any three numbers and display the middle number.
16. WAP to enter any 10 numbers and display the greatest one.
17. WAP to enter any 10 numbers and display the smallest one.
18. WAP to enter any 20 numbers and display the greatest one using array.
19. WAP to enter any 20 numbers and display the smallest one using array.
20. WAP to enter any 20 numbers and display the greatest and smallest one using array
SET F Qbasic Program Collections
1) Write a program using SUB – END SUB to calculate the volume of cube. (V=L3)
2) Write a program using FUNCTION – END FUNCTION to calculate and return area of circle. (A=Pr2)
3) Write a program to print square root of a number using Sub procedure.
4) Write a program using SUB – END SUB to print the area of rectangle. (A=L*B)
5) Write a program to calculate and print total surface area of a box using SUB – END statement. [A=2(LB+BH+LH) ]
6) Write a program to find out the cube root of an input number using FUNCTION– END FUNCTION.
7) Write a program using FUNCTION – END FUNCTION to calculate perimeter of rectangle. [P=2(L+B)]
8) Write a program using SUB – END SUB to print the area of rectangle. (A=L*B)
9) Write a program using SUB – END SUB to find out whether the input number is odd or even.
10) Write a program to display the average of given three numbers using FUNCTION…END FUNCITON.
11) Write a program using SUB – END SUB to get any two values from the user and print their sum.
12) Write a program to using FUNCTION – END FUNCTION to get any three values from user and print the largest value.
13) Write a program to input a number and check whether the given number is positive, negative or zero using SUB – END SUB.
14) Write a program using SUB – END SUB to get any two values from the user and print their product.
15) Using SUB…END SUB, Write a program to find the distance traveled by a body. [Hints: S=ut+1/2at2] where ‘S’ is distance traveled, ‘u’ is initial velocity, ‘t’ is time and ‘a’ is acceleration.
16) Write a program to print the perimeter of the circle using a function module. [perimeter of circle = 2Pr)
17) Write a program to calculate the volume of a box using Sub….End Sub. [V=l*b*h]
18) WAP to enter any three numbers and display the greatest, smallest and middle number using function.
19) WAP to display total surface area and volume of cylinder using function.
20) WAP to convert Dollar value into Nepalese Currency.
SET G Qbasic Program Collections
1. WAP to enter any word and check whether the given word is palindrome or not.
2. WAP to check whether the given number is Armstrong or not.
3. WAP to display the factors of a given number.
4. WAP to enter any number and check whether the given number is palindrome or not.
5. WAP to check whether the given number is prime or not.
6. WAP to check whether the given number is composite or not.
7. WAP to check whether the given number is prime or composite.
8. WAP to display the factorials of a given number.
9. WAP to display HCF of any two given numbers.
10. WAP to display LCM of any two given numbers.
11. WAP to display 9,7,5…….1.
12. WAP to display 10,20,30,40…………..100.
13. WAP to display 2,3,5,8,13……..10th terms.
14. WAP to display 1,1,2,3,5,8…….10th terms.
15. WAP to display 9,28,14,7,22,11…….10th terms.
16. WAP to display 7,22,11,34,17,52…………..10th terms.
17. WAP to display 5,55,555,5555,55555
18. WAP to display 11111,1111,111,11,1
19. WAP to display 10,12,15,19……10th terms.
20. WAP to display 50,46,41,35……………….10th terms.
SLC QBASIC SET A
1. What is a variable? Mention its types.
2. Read the above program and answer the following questions:
DECLARE FUNCTION check(a)
CLS
FOR i=1 TO 4
READ n
IF check(n) = 1 THEN PRINT n
NEXT i
DATA 256, 432, 125, 361
FUNCTION check(n)
s=SQR(n)
IF s=INT(s) THEN
check = 1
ELSE
check = 0
END IF
END FUNCTION
a. What is the output of the above program?
b. Does the program give the same output if INT() function is replaced by FIX() function?
c. If FOR I = 1 to 4 is changed as FOR i=1 to 5, then will the program run? Why?
d. Replace the FOR…NEXT loop with WHILE….WEND loop.
3. Write down the output of the following program.
FOR I = 1 TO 10
READ N
B=N MOD 5
IF B=0 THEN C=C+1
NEXT I
DATA 7, 15, 6, 10, 15, 32, 8, 22, 25, 5
PRINT C
END
4. Re-write the following program correcting the bugs:
REM to print given name 20 times
LET c=1
INPUT “Enter Name;n$
WHILE c less or equal to 20
Print n$
c+1=c
END
5. Write a program that allows entering a number and check whether the supplied number is positive, negative or zero.
6. Write a program to calculate the area of a triangle whose three sides a, b, c is given from the keyboard using FUNCTION….END FUNCTION.
SLC QBASIC SET B
1. Write down the truth table of AND operator.
2. Write down the output of the following program:
DIM A(10)
S=0
FOR I = 1 TO 10
READ A(I)
NEXT I
FOR J=10 TO 1 STEP -1
PRINT A(J);
S=S+A(J)
NEXT J
PRINT
PRINT S
DATA 5, 10, 15, 20, 25, 30, 35, 40, 45, 50
END
3. Re-write the following program correcting the bugs:
DO
OPEN “DATA.DAT” FOR OUTPUT AS 1
INPUT “NAME:”; N$
INPUT “CLASS:”;C$
INPUT “ROLL:”;R$
WRITE #1, N$, C$, R$
INPUT “Add another record/N)?”;and $
LOOP UNTIL UCASE$(ans$)=Y
END
4. Re-write the following program using WHILE…WEND:
S=0
FOR I = 1 TO 10
X=I^2
S=S+X
NEXT I
PRINT S
END
5. Write a program to generate following series: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144
6. Write a program using FUNCTION…….END FUNCTION statement to calculate simple interest for a given principle, time and rate of interest.
SLC QBASIC SET C
1. What is the use of immediate window in QBASIC’s editor?
2. Write down the output of the following program:
CLS
X=7
FOR C= 1 TO 10
PRINT X;
IF X MOD 2=0 THEN
X=X/2
ELSE
S=3*X+1
END IF
NEXT C
END
3. Re-write the following program correcting the bugs:
CLS
INPUT “ENTER A NAME”,N
PRINT LEFT$(N$,1);
FOR I = 1 TO LEN$(N$)
IF MID$(N$,1 1)=SPACE$(1) THEN
PRINT MIND$(N$,I+1,1);
NEXT N
END
4. Re-write the following program using FOR….NEXT:
SUN#=0
COUNT%=0
DO
INPUT NUM
IF NUM0 THEN
SUM#=SUM#+NUM
END IF
COUNT%=COUNT%+1
LOOP UNTIL COUNT%>10
PRINT SUM#
END
5. Write a program to generate the following series: 2, 1, 3, 4, 7, 11, 18, …. Up to 10th terms.
6. A sequential file ABC.REC contains the name and marks secured by students in 3 different subjects. Assuming the mark for each subject is 32, write a BASIC program to count the number of passed students.
SLC QBASIC SET D
1. What is the use and syntax of LET statement?
2. Write the output of the following program:
CLS
ST$=”PLNMPBENPLA”
FOR I = 1 TO 5
READ N
PRINT MID$(ST$,N,1)
NEXT I
DATA 3, 7, 9, 11, 2
END
3. Re-write the following program correcting the bugs:
Rem Find the sun of ASCII codes of characters
st$=”COMPUTER”
C=1
S=0
DO WHILE Cb THEN
s=s+a
ELSE
s=s+b
END IF
PRINT s
END SUB
a. What is the output of the above program?
b. If the statement STATIC s is removed, then what will be the change in its output?
c. If the statement PRINT s is places in main module just below the statement CALL take(a,b), then what will be the output?
d. List out the formal arguments and actual arguments from the above program.
3. Write down the output of the following program:
CLS
FOR I = 1 TO 5
READ A$,A
PRINT MID$(A$,A,1)
NEXT I
DATA COMPUTER, 4, ORACLE, 1, WINDOW, 6
DATA KEYBOARD, 2, FORTRAN, 5
END
4. Re-write the following program correcting the bugs:
REM to find product of the even numbers from 10 to supplied nos.
P=0
FOR C=1 TO TEN
INPUT N
IF N MOD 2>0 THEN
P=P*N
END IF
NEXT
DISPLAY P
END
5. Write a program to find the greatest number among the 10 numbers given by the users.
6. A sequential data file “STUDENT.DAT” has fields name, roll and address. Write a program to display those records.
SLC QBASIC SET F
1a) What command is used to do following tasks in QBASIC?
i) To list files from current directory.
ii) To create a directory
b) Write down the output of the following program.
CLS
C = 1
FOR I = 2 TO 8 STEP 2
PRINT C;
SWAP B, C
C = B + 1
NEXT I
END
c) Re-write the following program correcting the bugs:
REM To find the sum of square upto ten natural nos.
CLS
X = 1
DO WHILE X >= 10
A = X2
S = S + A
LOOP
PRINT "Sum of Square:"; SUM
END
d) Re-write the following program using WHILE……..WEND.
CLS
FOR I = 1 TO 5
FOR J = 1 TO I
PRINT J;
NEXT J
PRINT
NEXT I
END
e) Write a program to declare a user defined function to check whether the supplied string is palindrome or not using FUNCTION….END FUNCTION statement. The program should input string and uses the above function to check whether it is palindrome or not.
f) WAP to open a data file “LIBRARY.DAT” in output mode and store information of books. Data file should store information such as book title, author price, date of purchase and publisher. The program should allow user to input records as needed
SLC QBASIC SET G
1a) Define loop and nested loop.
b) Write down the output of the following program.
CLS
FOR B = 1 TO 5
READ N$
M$ = M$ + MID$(N$, B, 1)
NEXT B
PRINT M$
DATA NATURE, TECHNO, HAPPY, GOPAL, PUPILS
END
c) Re-write the following program correcting the bugs:
REM to check if a word is palindrome
INPUT N$
FOR K = LEN(N$) TO 1
W$ = S$ + MID$(N$, K, 1)
NEXT K
IF N$ = W$ THEN
PRINT "Palindrome"
OTHERWISE
PRINT "Not Palindrome"
END
d) Re-write the following program using DO……..LOOP UNTIL
CLS
FOR J = 20 TO 2 STEP -2
S = S + J
NEXT J
PRINT "Sum of even numbers"; S
END
e) Write a program using FUNCTION….END FUNCTION statement to display the longest string among three input strings.
f) A sequential data file “EXAM.DAT” contains name, address, phone number and age of some people. Write a program to display only those records which contains age above 18 and address is ‘Lumbini’.
SLC QBASIC SET H
1a) What is variable? List the types of numeric data.
b) Study the following program and answer the following questions:
OPEN “detail.dat” FOR INPUT AS #1
OPEN “temp.dat” FOR OUTPUT AS #2
CLS
INPUT “Name of the students “; s$
FOR i = 1 to 10
INPUT #1, n$, c, a
IF s$ < > n$ THEN
WRITE #2, n$, c, a
END IF
NEXT i
CLOSE #1, #2
KILL “detail.dat”
NAME “temp.dat” AS “detail.dat”
END
Questions:
i) What is the main objective of the above program?
ii) Will the program run if the statement KILL “detail.dat” is removed? Why?
iii) If the data file “detail.dat” contains only 8 records, then the program will run? Why?
iv) Why the file “temp.dat” is necessary in this program?
c) Write down the output of the following program.
CLS
FOR X = 2 TO 15 STEP 2
IF X >= 11 THEN EXIT FOR
PRINT X ^ 2 + 1
NEXT X
PRINT "Done"
END
d) Re-write the following program correcting the bugs:
CLS
REM TO PRINT THE LONGEST STRING
DATA TOURISM, TRANSPORT, SERVICE, AGRICULTURE, TRADE
READ L$
FOR C = 1 TO 5
READ X$
IF LEN(X$) > LEN(L$) THEN X$ = L$
NEXT C
PRINT "LONGEST STRING IS: L$"
END
e) Re-write the following program using FOR…NEXT
CLS
N = 1
X = 1
BACK:
PRINT N, N ^ 2
N = N + 2
X = X + 1
IF X