Thursday, March 23, 2017

SEE 2073 Computer Science Question Solved




SEE 2073
Computer Science

1. Answer the following questions.

a) Write any two advantages of BUS topology.
Ans: The advantages of bus topology are:
It is easy to set up computers and other devices in bus topology, because all the devices are connected through a single wire.
It requires fewer cable media, so it is cheaper than other topologies.

b) Define computer security.
Ans: The security given to the computer for the protection of hardware, software and data from being lost or damaged due to accidental or intentional harm is known as computer security.

c) Write any two preventive measures to protect computer system from computer virus.
Ans: Any two preventive measures are:
i) Do not install pirated software, especially computer games
ii) Scan the mail or unknown files of internet before opening in your computers.

d) What is multimedia?
Ans: Multimedia is the integration of multiple forms of media, which presents information in more interesting and understandable way.

e) Write the use/function of File Transfer Protocol.
Ans: The use of File Transfer Protocol is to transfer the file from one computer to another computer. It helps to upload and download the files.

2. a) Perform the conversion as per the direction:
            i) (BAD)16 into binary
            Soln:
            Converting Hexadecimal to Binary
            B = 1011
            A = 1010
            D = 1101
            (BAD)16 = (101110101101)2

ii) (1111001)2 into octal
Soln:
Converting Binary to octal
001 = 1
111 = 7
001 = 1
(1111001)2 = (171)8
           
b) Perform the binary calculations:
            i) 11 × 10 + 11

1
1
×
1
0

0
0
1
1
×
1
1
0
Now, Adding with 11

           
1
0

+
1
1
1
0
0
1
                       
 11 × 10 + 11 = 1001
                       
            ii) 110  ¸ 10
10)
 110 (
11

-10


   10


   10


   00


            Quotient = 11
            Remainder = 00

3. Match the following:
a) Malicious software                        i) UPS
b) Primary storage device                  ii) virus
c) Power protection Device                iii) copyright
d) Intellectual property law                iv) RAM
                                                            v) CD-ROM

Answer
a) Malicious software            virus
b) Primary storage device      RAM
c) Power protection Device    UPS
d) Intellectual property law    copyright

4. State whether the following statements are true or false:
a) Computer Network reduces the cost. True
b) WWW is an organization which controls Internet. False
c) Microwave transmission is an example of bound media. False
d) The parts of the computer which can be seen and touched are called hardware. True

5. Write the appropriate technical terms of the following:
a) A type of network in which every computer works as both client and server.
Ans: Peer-to-peer network
b) Protocol used to receive email from the mail server.
Ans: POP( post office protocol)
c) The moving graphics images.
Ans: Animation
d) The law that controls cyber crimes.
Ans: Cyber Law

6. Write the full forms:
a) LAN: Local Area Network.
b)ROM: Read Only Memory.
c) SMTP: Simple Mail Transfer Protocol.
d)NOS: Network Operating System.

7. Answer the following questions.

a) Define data and database.
Ans: Data can be numbers, letters or symbols representing facts and figures which may or may not give any sense. Database is a collection of related and organized information that can be used for different purpose.

b) What is primary key? Write its importance.
Ans: Primary key is a field that uniquely identifies the record. It is needed because it neither accepts duplicate values nor  permit null values.
The importance of Primary key are:
i) To reduce and control duplication of record in a table.
ii) To set the relationship between tables.

c) Name any four data types used in MS-Access.
Ans: Any four data types of MS-Access are:
i) Text
ii) Number
iii) Memo
iv) Currency

8. Select the correct answer:
a) The columns in a database table are called………………………
Ans: Field
b) Which is the suitable data type to store video?
Ans: OLE object
c) …………… object of MS-Access is used to print formatted data.
Ans: Report
d) Which is not a type of query?
Ans: Search

9. Match the following:
a) Query                     i) Printed format
b) Form                       ii) Stores data
c) Table                       iii) Allows view, edit, input data
d) Report                    iv) Extracts selected record for view
                                    v) DBMS

Answer
a) Query                     Extracts selected record for view
b) Form                       Allows view, edit, input data
c) Table                       Stores data
d) Report                    Printed format


10.
a) What is a loop?
Ans: Loop can de defined as repeating the statement of statement blocks for a number of times.
b) Write the functions of  NAME and CLOSE statements.
Ans: The function of NAME statement is to  renames a file on a diskette.  The function of CLOSE statement is to close one or all open files.
c) What is variable?
Ans: The data item whose value changes during the execution of a program is called variable.



11. Re-write the given program after correcting the bugs:
DECLARE SUB SUM(N)
INPUT “Any Number”; N
PRINT SUM(N)
END
SUB SUM (N)
S=0
WHILE N=0
R= R MOD 10
S=S+R
N=N/10
WEND
PRINT “Sum of digits”;S
END

Debugged Program

DECLARE SUB SUM(N)
INPUT “Any Number”; N
CALL SUM(N)
END
SUB SUM (N)
S=0
WHILE N< >0
R= N MOD 10
S=S + R
N=N \ 10
WEND
PRINT “Sum of digits”;S
END

12. Write the output of the following program.
DECLARE FUNCTION AREA (L, B)
CLS
LET L = 50
LET B = 10
LET ans = “; ans
PRINT “The area=”; ans
END

FUNCTION AREA (L, B)
Ar=L*B
AREA=ar
END FUNCTION

Output
The area = 500


13. State the following program and answer the given questions:
DECLARE FUNCTION Diff(A, B)
CLS
INPUT “Enter first number”; A
INPUT “Enter second number”; B
PRINT “The difference”; Diff(A, B)
END

FUNCTION Diff(A, B)
Difference= A – B
Diff = difference
END FUNCTION

List all the numeric variables used in the above program.
Ans: The numeric variables used in the above program are A, B and Difference

List the local variables used in the above program.
Ans: The local variables used in the above program is A, B and Difference

14
a) Write a program to calculate the area of four walls using Sub….End Sub. [Hint: Area=2H(L+B)
DECLARE SUB AREA (L, B, H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
CALL AREA (L, B, H)
END

SUB AREA (L, B, H)
A = 2 * H * (L + B)
PRINT “AREA OF FOUR WALLS”; A
END SUB
b) Write a program to input a word in the main module and count the total number of vowel characters present in the word using FUNCTION…END FUNCTION.
DECLARE FUNCTION COUNT (S$)
CLS
INPUT "ENTER ANY STRING"; S$
PRINT "TOTAL NO. OF VOWELS= "; COUNT(S$)
END

FUNCTION COUNT (S$)
VC = 0
FOR I = 1 TO LEN(S$)
B$ = MID$(S$, I, 1)
C$ = UCASE$(B$)
IF C$ = "A" OR C$ = "E" OR C$ = "I" OR C$ = "O" OR C$ = "U" THEN
VC = VC + 1
END IF
NEXT I
COUNT = VC
END FUNCTION
c) Create a data file to store the records of few employees having Name, Address, Post, Gender and Salary fields.

            OPEN “std.rec” FOR OUTPUT AS #1
            DO
CLS
            INPUT “Enter Name”; N$
            INPUT “Enter Address”; A$
            INPUT “Enter Post”; P$
            INPUT “Enter gender”; G$
            INPUT “Enter Salary”; S
            WRITE #1, N$, A$, P$, G$, S
            INPUT “Do you want to continue”; CH$
            LOOP WHILE UCASE$(CH$)=”Y”
            CLOSE #1
            END

#ThankYou Reshu Acharya For Solving

Monday, March 13, 2017

Write a Qbasic Program to generate 0.1, 0.22, 0.333, 0.4444, 0.55555

Write a Qbasic Program to generate 0.1, 0.22, 0.333, 0.4444, 0.55555


CLS
B = 10
FOR I = 1 TO 5
A = A + 10 ^ (I - 1)
PRINT (I * A) / B
B=B*10
NEXT I
END

 

Sunday, March 5, 2017

Write a QBASIC Program to generate the series: 315, 270, 215, 150 ........ upto 10th term.

Write a QBASIC Program to generate the series: 315, 270, 215, 150 ........ upto 10th term.
CLS
a = 315
b = 45
FOR i = 1 TO 10
    PRINT a
    a = a - b
    b = b + 10
NEXT i
END

Thursday, February 23, 2017

WRITE A QBASIC PROGRAM TO DISPLAY *nepal* *nepa* *nep* *ne* *n*

WRITE A QBASIC PROGRAM TO DISPLAY
*nepal*
*nepa*
*nep*
*ne*
*n*
CLS
A$ = "nepal"
FOR i = LEN(A$) TO 1 STEP -1
    PRINT "*"; LEFT$(A$, i); "*"
NEXT i
END

Sequential File Handling SLC QBasic Programming



1.     Write a program in qbasic to open a sequential data file “emp.dat”, which contains employees records: name, address and phone number and display all the records as well as total number of records stored in the file. [slc 2064]
2.     Write a program to store records regarding the information of book number, book’s name and write’s name in a sequential data file called “library.dat”. [slc 2065]
3.     Write a program to create a sequential data file “employee.dat” to store employees’ name, address, age, gender and salary. [slc 2066]
4.     A sequential data file “emp.dat” contains name, post and salary fields of information about employees. Write a program to display all the information of employees along with tax amount (also tax is 15% of salary). [slc 2067]
5.     A sequential data file called “student.dat” contains same records under the field’s name, english, nepali and computer. Write a program to add some more records in the same sequential data file. [slc 2068]
6.     Write a program to create a data file ‘teldir.dat’ to store name, address and telephone number of employees according to the need of the user. [slc 2069]
7.     A sequential data file called “marks.dat” contains name, english, nepali, maths and science fields. Write a program to display all the contents of that data file. [slc 2070]
8.     A sequential data file called “marks.dat” contains roll number, name, english, nepali, and maths field. Write a program to display all the content of the data file. [slc 2065 supplementary]
9.     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. [slc 2066 supplementary]
10.  A sequential data file called ‘marks.dat’ contains roll no, name, english, and nepali and maths fields. Write a program to display all the contents of the data file. [slc 2067 supplementary]
11.  Write a program to view those records from “employee.dat” sequential data file having employee’s name, department, appointment data and salary whose salary is more than rs.5000.[slc 2068 supplementary]
12.  A sequential data file “staff.dat” contains the name, address, post and salary of the employees. Write a program to read and display all the records stored in the above data file. [slc 2069 supplementary]
13.  A sequential data file named”rec.dat”contains name,post and salary.  Write a program to display all the records for the employees whose salary is more than 8000. [maaf pre send up 2069 set b]
14.  A sequential data file named “record.dat” contains first name, last name and age. Write a program to display all the records whose age is more than 60. [maaf pre send up 2069 set a]
15.  Write a program to open a data file “record.dat” that contains name, address, date of birth, email and telephone number of some employees. Now display all those records whose date of birth is in current month. [pabson pre send up 2070]
16.  Write a program to display all records having salary less than 2500 from the data file “add.inf” having the field’s name, post and salary. [pabson
pre send up 2066]
17.  Wap to delete some records from “neps.dat” file where computer ask user to enter the record, which is to be deleted. (fields are name, address, and telephone number). [neps pre send up 2066]
18.  Write a program to open a data file “student.dat” that contains name, address, telephone number and parent’s name of some students. Now display all those records whose address is “lalitpur”. [pabson pre send up 2064]
19.  Create a sequential data file “std.dat” to store name and marks obtain in english, maths and science for a few students. [slc model question 2065]
20.  Create a sequential data file “hotel.dat” to store customers name, address, and phone number. Program should terminate with user’s choice. [slc model question 2]

Saturday, December 31, 2016

MODULAR PROGRAMMING FILE HANDLING C LANGUAGE THEORY QUESTIONS COLLECTION [3 MARKS]



MODULAR PROGRAMMING FILE HANDLING C LANGUAGE THEORY QUESTIONS COLLECTION [3 MARKS]


  • 1.     Define Modular Programming.
  • 2.     Write any two advantages of modular programming.
  • 3.     Write any two disadvantages of modular programming.
  • 4.     Define procedure.
  • 5.     Mention the types of procedure.
  • 6.     Write down the difference between function procedure and sub procedure.
  • 7.     What is loop?
  • 8.     What is variable?
  • 9.     Differentiate between user defined function and in-built function.
  • 10.  What do you mean by local variable and global variable?
  • 11.  Define parameter and argument.
  • 12.  Write the syntax and example of SUB….END SUB and FUNCTION…END FUNCTION statement.
  • 13.  Explain accumulator with an example.
  •  
  •  
  • 1.     List any four data types used in C language.
  • 2.     List any two features / characteristics of C language.
  • 3.     Write any two differences between QBasic and C language.
  • 4.     Write any two similarities between QBasic and C language.
  • 5.     Write any two advantages of structured programming language.
  • 6.     Why is C called structured programming language / procedural oriented program?
  • 7.     When and Who developed C language?
  • 8.     Define keyword. How many keywords are there in C language?
  • 9.     Define Unary Operator.

  • 1.     What is meant by mode of data file?
  • 2.     Define program file and data file.

  • Write the functions of:

  • 1.     MKDIR
  • 2.     NAME
  • 3.     CLOSE
  • 4.     KILL
  • 5.     RMDIR
  • 6.     EOF
  • 7.     FILES
  • 8.     CALL
  • 9.     OPEN
  • 10.  SHARED



  • 1.     INPUT
  • 2.     INPUT #
  • 3.     LINE INPUT#
  • 4.     SHELL
  • 5.     WRITE #
  • 6.     PRINT #
  • 7.     INPUT $
  • 8.     COMMON SHARED
  • 9.     VAL
  • 10.  CINT


QBASIC NUMBER SERIES PROGRAM 2, 4, 8, 14, 22, ………UP TO 15th TERM

 QBASIC NUMBER SERIES PROGRAM 
2, 4, 8, 14, 22, ………UP TO 15th  TERM

DECLARE SUB SERIES ( )
CLS
CALL SERIES
END

SUB SERIES
A = 2
B = 2
FOR I = 1 TO 15
    PRINT A,
    A = A + B
    B = B + 2
NEXT I
END SUB

Friday, December 30, 2016

Qbasic Program that accept the full name of the person and display the initial character of the first name and middle name with full family name.(eg.Meg Bahadur Thapa as M.B.Thapa)

Write a QBasic Program that accept the full name of the person and display the initial character of the first name and middle name with full family name.(eg.Meg Bahadur Thapa as M.B.Thapa)

CLS
INPUT "ENTER FULL NAME"; A$
B$ = LEFT$(A$, 1)
FOR J = 1 TO LEN(A$)
    C$ = MID$(A$, J, 1)
    IF C$ = " " THEN B$ = B$ + "." + MID$(A$, J + 1, 1)
NEXT J

FOR I = LEN(A$) TO 1 STEP -1
    D$ = MID$(A$, I, 1)
    F = F + 1
    IF D$ = " " THEN
        E$ = E$ + RIGHT$(A$, F - 2)
        EXIT FOR
    END IF
NEXT I

PRINT B$ + E$
END