Friday, April 29, 2022

Solved Computer Science SEE 2078

 

SEE 2078

Solved Computer Science

1. Answer the following questions in one sentence:       6x1=6

a) Write the name of any two search engines.

Ans: The name of any two search engines is google.com and ask.com

b) What is social media?

Ans: Social media is computer-based technology that facilitates the sharing of ideas, thoughts, and information through the building of virtual networks and communities.

c) Which data type is suitable to store photographs of students in MS-Access?

Ans: The suitable data type to store photographs of students in MS-Access is OLE object.

d) Which view is used to modify a table structure in MS-Access?

Ans: Design View is used to modify a table structure in MS-Access.

e) Which statement is used to call sub-procedure?

Ans: CALL statement is used to call sub-procedure.

f) Write any two data types used in C language.

Ans: Any two data types used in C language are int and char.

2. Write appropriate technical term for the following. 2x1=2

a) A system of copying data and information reading in computer into another location. Backup

b) A company which provides services of Internet. Internet Service Provider (ISP)

3. Write the full form of the following.    2x1=2

a) FTP: File Transfer Protocol

b) MAN: Metropolitan Area Network

4. Answer the following questions.          9x2=18

a) What is computer network? Write any two advantages of it.

Ans: A computer network means two or more computers connected with each other to share data, hardware, software and other resources.

Any two advantages of computer network are:

·       Computer in a network can access the network-connected hardware devices like printers, disk drives, etc.

·       Computers in a network system share different software packages.

b) Define software security. Write any two protection measures for it.

Ans: The security given to the software and data from being lost or damaged due to accidental or intentional harm is called software security.

Any two protection measures for software security are:

·       Backup

·       Password

c) What is search engine? Write any two popular search engines.

Ans: A search engine is a Website that lets you search the Internet for Websites on specific topics.

The name of any two popular search engines is google.com and ask.com

d) Define e-commerce. Write any two benefits of it.

Ans: Ecommerce, also known as electronic commerce or internet commerce, refers to the buying and selling of goods or services using the internet.

Any two benefits of e-commerce are:

·       It makes buying/selling possible 24/7.

·       It makes buying selling procedure faster, as well as easy to find products.

e) Write ant two advantages and disadvantages of social media.

Ans: Any two advantages of social media are:

·       People from anywhere can connect with anyone. Regardless of the location and religion.

·       Millions of people are using social media platforms so it has a great opportunity to promote business.

Any two disadvantages of social media are:

·       Personal data and privacy can be easily hacked and shared on the internet.

·       More chances of spreading unnecessary rumour soon.

f) What is DBMS? Write any two advantages of it.

Ans: DBMS is a software which helps to extract, view and manipulate data in an organized way.

Any two advantages of DBMS are:

·       It controls data redundancy which means duplication of data.

·       Large volume of data can be stored and updated easily.

 

g) What is primary key? Write any two features of it.

Ans: A key that uniquely identifies each record in a database is primary key.

Any two features of primary key are:

·       To reduce and control duplication of record in a table.

·       To set the relationship between tables.

h) Define field and record.

Ans: A column in a table is called field, and it contains a specific piece of information within a record.  Record is a collection of multiple related fields in a row which gives complete information about a person or thing.

i) Define form. Write any two uses of it.

Ans: Form is an object of Ms-Access which provides graphical interface to enter data into the tables or multiple linked tables.

Any two uses of form are:

·       It provides an interactive platform for input of data into the database.

·       It helps to display data in more presentable form than a datasheet.

5. Write the output of the given program: (Workout with a dry run).  2

DECLARE SUB ABC(A)

CLS

A=2

CALL ABC(A)

END

SUB ABC(A)

FOR J= 1 TO 5

PRINT A;

A=A+3;

NEXT J

END SUB

 

Dry run

Variable

Variable

 

Output

A

J

Loop Check

 

2

1

1 to 5 Yes

2  5  8  11  14

5

2

2 to 5 Yes

 

8

3

3 to 5 Yes

 

11

4

4 to 5 Yes

 

14

5

5 to 5 Yes

 

17

6

6 to 5 No (loop exits)

 

 

Output

2  5  8  11  14

 

6. Re-write the given program after correcting the bugs:         2

DECLARE SUB Series ( )

CLS

EXECUTE Series

END

 

SUB Series( )

REM Program to generate 1 1 2 3 5 .....upto the 20th terms

A=1

B=1

FOR ctr=10 to 1

DISPLAY A:B:

A=A+B

B=A+B

NEXT ctr

END Series ( )

 

Debugged Program

 

DECLARE SUB Series ( )

CLS

CALL Series

END

 

SUB Series( )

REM Program to generate 1 1 2 3 5 .....upto the 20th terms

A=1

B=1

FOR ctr=1 TO 10

PRINT  A; B;

A=A+B

B=A+B

NEXT ctr

END SUB

 

7. Study the following program and answer the given questions.          2x1=2

DECLARE FUNCTION TEST(X)

X=100

Z=TEST(X)

PRINT Z

END

 

FUNCTION TEST(X)

FOR R=1 TO X

S=S+I

NEXT R

TEST=S

END FUNCTION

a) How many parameters are used in the above program?

Ans: The parameters are used in the above program is one.

b) How many times does the statement S=S+I execute in the above program?

The statement S=S+I will execute 100 times in the above program

 

8. Convert / Calculate as per the instruction.     4x1=4

i) (11111101)2 = (?)16

Soln:

Paired Binary Digit

1111

1101

Binary Equivalent value

F

D

 

\ (11111101)2 = (FD)16

 

ii) (245)10 = (?)2

Soln:

2

245

Remainder

2

122

1

2

61

0

2

30

1

2

15

0

2

7

1

2

3

1

2

1

1

 

0

1

 

\  (245)10 = (11110101)2

 

iii) (1010) 2 x (101) 2 =(?)2

 

 

 

1

0

1

0

 

 

x

1

0

1

 

 

1

0

1

0

 

0

0

0

0

x

1

0

1

0

x

x

1

1

0

0

1

0

 

\ (1010) 2 x (101) 2 =(110010)2

 

 

 

 

 

 

iv) (101110) 2 ¸ (110) 2

110)

101110(

0111

 

000

 

 

1011

 

 

-110

 

 

1011

 

 

-110

 

 

1010

 

 

-110

 

 

100

 

 

\ Quotient = 111

     Remainder = 100

 

 

 

 

 

 

9 a) 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]]

 

DECLARE FUNCTION AREA (L,B)

DECLARE SUB PER(L,B)

CLS

INPUT “Enter Length”; L

INPUT “Enter Breadth”; B

PRINT “Area of rectangle=”; AREA(L,B)

CALL PER(L,B)

END

FUNCTION AREA(L,B)

AREA = L*B

END FUNCTION

 

SUB PER(L,B)

P=2*(L+B)

PRINT “Perimeter of rectangle=”; P

END SUB

 

b) Write a program to create a sequential data file “salary.dat” to store programmer’s name, salary and post according to the need of the user.

 

OPEN “salary.dat” FOR OUTPUT AS #1

DO

CLS
INPUT “Enter name”; N$

INPUT “Enter Salary”; S

INPUT “Enter Post”; P$

WRITE #1, N$, S, P$

INPUT “Do you want to continue(Y/N)”; CH$

LOOP WHILE UCASE$(CH$)=”Y”

CLOSE #1

END

 

10.  Write a C program that asks a number and check whether it is negative, positive or zero.

 

 

#include<stdio.h>

#include<conio.h>

int main()

{

int n;

printf("Enter any number: ");

scanf("%d", &n);

if(n>0)

printf("%d is positive number",n);

else if(n<0)

printf("%d is negative number",n);

else

printf("%d is zero number",n);

return 0;

}

OR

Write a program in C language to display first 10 odd numbers.

#include<stdio.h>

#include<conio.h>

int main()

{

int i, a;

i=1;

a=1;

while(i<=10)

{

    printf("%d \n", a);

    a=a+2;

    i++;

}

return 0;

}

 

 

 

Saturday, April 9, 2022

Modular Programming Question Collection Qbasic 2078

 PROGRAMMING QUESTION

[9 Marks]

 

Group A

1.      Write a program to calculate the volume of a cylinder using FUNCTION….END FUNCTION.[ MODEL 2065], [ 2071 S]

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

3.      Write a program using SUB…END SUB to get radius of circle and then print its area./FUNCTION [ 2065 S], [ 2071 R] [2074U][2074]

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

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

6.      Using FUNCTION…END FUNCTION Write a program to calculate the average of three numbers. [ 2067 R], [ 2070 S][2075]

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

8.      Write a program to calculate the area of four walls using SUB…END SUB / FUNCTION. [ 2068 R], [ 2073][2075U]

9.      Write a program in QBASIC to find the total surface area of a box using FUNCTION…END FUNCTION. [ 2068 S]

10.   Write a program to calculate and print the simple interest using FUNCTION…END FUNCTION. [ 2069 S]

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

12.   Write a program using FUNCTION…END FUNCTION, to find the area of triangle. [ 2072]

 

 

Group B

1.      Write a program using FUNCTION…END FUNCTION, to get a word from the user and the print the word in reverse order. [ 2065 S], [ 2067 S], [ 2068 R][2074U]

2.      Write a program to declare SUB procedure to print only the vowels from a given word. [ 2066 R]

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

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

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

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

 

 

Group C

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

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

3.      Write a program to input three different numbers in the main module and then find the greatest number using SUB…END SUB. [ 2068 S]

4.      Using Functions ........ End Functions write a program to find odd or even. [20475U]

 

Group D

1.      Using SUB…END SUB Write a program to print the following series 9,7,5,…1. [ 2065 R]

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

3.      Write a program to print natural numbers from 1 to 5 using SUB…END SUB. [ 2069 S]

4.      Write a program using SUB…END SUB to print the first ten odd numbers. [ 2071 S]

5.      Write a program to print the sum of digits of a given number using SUB procedure. [ 2070 S]

 

 

Tuesday, April 5, 2022

QBASIC FILE HANDLING PROGRAMMING QUESTIONS[ SEE COLLECTION] [4 Marks]

 QBASIC FILE HANDLING PROGRAMMING QUESTIONS[ SEE COLLECTION]


1.      Create a sequential data file “std.dat” to store name and marks obtained in English, Math and Science subjects for a few students. [ MODEL 2065]

2.      Write a program to store records regarding the information of Book Number, Book’s name and Writer’s name in a sequential data file called “Library.dat”. [ 2065 R]

3.      A sequential data file called “MARKS.DAT” contains roll no., name, English, nepali and maths fields. Write a program to display all the contents of data file. [ 2065 S], [ 2067 S]

4.      Write a program to create a sequential  data file “Employee.dat” to store employees’ name, address, age and gender. [ 2066 R]

5.      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. [ 2066 S]

6.      A sequential data file “EMP.DAT” contains name, post and salary fields of information about employees. Write a program to display all information of employees along with tax amount also.(Tax is 15% of salary) [ 2067 R]

7.      Write a program to create a data file 'emp.dat' to store employees name, post, address and salary according to the need of the user. [2075U]

8.      Write a program to store Roll no., Name, Class and Address of any five students. [2074]

9.      A sequential data file called “student.dat” contains some records under the fields Name, English, Nepali and computer. Write a program to add some more records in the same sequential data file. [ 2068 R]

10.   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. [ 2068 S]

11.   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. [ 2069 R]

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 file. [ 2069 S]

13.   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. [ 2070 R]

14.   A sequential data file “Record.dat” has records with field name, addres, age and salary. Write a program to display only those records whose age is greater than 26. [ 2070 S]

15.   A data file “Salary.dat” contains the information of employee regarding their name, post and salary/ Write a program to display all the information of employee whose salary is greater than 15000 and less than 40000. [ 2071 R]

16.   A data file “STAFF.DAT” has stored records of few employees with emp id, first name, last name, post and salary. Write a program to display all the records of the employees whose salary is more than 40,000.[2075]

17.   A sequential data file called “Marks.dat” has stored data under the field heading Roll No, Name, English, Nepali and maths. Write a program to display all the information of those students whose marks in Nepali is more than 50. [ 2071 S]

18.   A Sequential data file called ".DAT" has stored data under the field heading Symbol No., Name, English, Nepali, Maths and Computer. Write a program to display all the information of those students whose marks in Computer is more than 80. [2074U]

19.   A sequential data file called “Marks.dat” contains NAME, AGE, CITY AND TELEPHONE fields. Write a program to display all the contents of the data file. [ 2072]

20.   Create a data file to store the records of few employees having Name, Address, Post, Gender and Salary fields. [ 2073]