see programming solution 2076

SEE Programming Solution 2076

SEE Solution

SEE Programming solution 2076

This is SEE programming  solution  2076 which gives you idea how to solve the qbasic part of SEE examination. This part contain the 18 marks where all the types of questions are available. The questions are varied from the simple to hard and hope SEE programming  solution  2076 will review your practice work.

10 a. What is user defined function?

Ans: The function which is created by user to perform a specific task is called user define function.

10.b. List any two data types used in C Language.

Ans: The two data types used in C Language are int and float.

10.c. Write down the function of following statements.

KILL- This  statement is used to delete an existing program file in qbasic.

READ  SEE Science Model Solution 2076

FILES- This statement is used to display the all files in qbasic.

 

 

11. Write the output of given problem:

DECLARE SUB Result

CALL Result

END

SUB Result

For I= 1 to 9 step 2

Sum=sum+I^2

NEXT I

PRINT Sum

END SUB

 

Ans: The output of the program is 165

 

12. Rewrite the given program after correcting the bugs:

REM to store name, post and salary

OPEN EMP DOC FOR OUT AS#1

INPUT “Enter Name” N

INPUT “Enter Post” p$

INPUT ” Enter Salary; S

WRITE #2, N$, P$, S

CLOSE#1

END

 

Ans: The correct program is

REM to store name, post and salary

OPEN “EMP.DOC” FOR OUTPUT AS#1

INPUT “Enter Name” N$

INPUT “Enter Post” p$

INPUT ” Enter Salary; S

WRITE #1, N$, P$, S

CLOSE#1

READ  SEE Model Question Solution 2076

END

 

 

13. Study the following program and answer the given questions:

Rem *to count voweis*

DECLARE FUNCTION COUNT (AS)

Input *Enter a word* ; w$

END

FUNCTION Count (A$)

B= LEN (A$)

C$=UCASE$ (A$)

FOR I=1 TO B

E$= MID$ (C$, I, 1)

IF E$=”A” OR E$=”E” OR E$= “I”

OR E$= “O” OR E$= ‘U’ THEN

C=C+1

End IF

NEXT I

Count=C

END FUNCTION

 

a. List the string library function used in the above program.

Ans: String library functions are Ucase$(),Mid$()

b. Write down the missing statement in the main module to execute the program.

Ans: The missing statement in main module is

Print count(w$) in line number 3

 

14.a.Write a program using function……….. End Function to find the average of any two numbers given by the user.

DECLARE FUNCTION AV(A,B)

READ  SEE Model Question Solution English 2076

CLS

INPUT “ENTER FIRST NUMBER” ;A

INPUT “ENTER SECOND NUMBER”;B

PRINT AV(A,B)

END

FUNCTION AV(A,B)

AV=(A+B)/2

END FUNCTION

 

14.b.Write a program using SUB….. END SUB to check whether a number given by user is positive of negative.

DECLARE SUB CHECK(A)

CLS

INPUT “ENTER A NUMBER”;A

CALL CHECK(A)

END

SUB CHECK(A)

IF SGN(A)=1 THEN

PRINT “NUMBER IS POSITIVE”

ELSE

PRINT “NUMBER IS NEGATIVE”

ENDIF

 

14.c. A data file “LIB.TXT” consists of Book’s name, Author’s name and price of books. Write a program to count and display the total number of records present in the file.

CLS

OPEN “LIB.TXT” FOR INPUT AS $1

WHILE NOT EOF(1)

INPUT #1, B$,A$,P

C=C+1

WEND

PRINT “TOTAL NUMBER OF RECORDS”;C

CLOSE#1

END

 

Watch this Explanation

Leave a Reply

Your email address will not be published.