1. Home
  2. Docs
  3. Model Question solution(S...
  4. Computer Science
  5. Model questions and solution (I)

Model questions and solution (I)

Ans: Search engine is a web application which allows user to search the content from the internet based in their queries. E.g. Google, Bing

Ans: E-Commerce is the business done through the internet

Ans: “Text” data type is used to store numeric characters or special symbols in MS-Access

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

Ans: The process of breaking down a large program into smaller logical and manageable part is called modular programming.

Ans: Two features of C language are :

  • It is structural programming language.
  • It supports graphics.

    Ans: [Cyber Law]

    Ans: [Quantum Bit]

    I. STP: Shielded Twisted Pair

    II. WAP: Wireless Application Protocol

    Ans: A  group of computers interconnected with each other through any medium   using definite rule(protocol) for the purpose of sharing data, information, hardware, software and other resources. The advantages are:

    • Expensive hardware like printer, scanner etc can be shared in a network. So, it is cost effective.
    • It allows several user to share data in real time.

    Ans: Computer ethics are the moral code of conduct or set of principles that guides computer user about the wise and safe use of computers and other electronic media. It generally aware computer user from misuse and exploitation of technology.

    • Don’t use computer and internet to commit crime (cyber crime).
    • Use computer to share and gain knowledge.

    Ans: The protection or securing computer data, information and software from being damaged or lost accidentally or intentionally is known as software security.

    The two measures of hardware security are:

    • Use power protection device like UPS, volt guard, CVT.
    • Maintain dust free environment.

    Ans: M-Commerce refers to Mobile-Commerce which is an extended version of E-Commerce where buying and selling goods, services and information are done through handheld devices like mobile phone, tablets, PDAs etc. E.g. movie tickets, flight ticket. The two important services are:

    • Mobile banking
    • Hotel Booking

    Ans: IoT (Internet of Things) is the network of real world “Things” (Devices) made with sensors, software, hardware and other various modern technology that can communicate with the user and devices along with its environment. E.g. smart watch, voice assistant, smart car. Its importance are:

    • It increase efficiency and productivity of work.
    • It helps to automate our daily life work.

    Ans: The systematic and scientific collection of data that can be retrieved or access whenever required is called database. It is the organized way of collecting and keeping data and information. E.g. Dictionary, Telephone directory, Marks ledger etc.

    Ans: The key or field that is used to uniquely identify records from the database table is called primary key. It must be unique and cannot be kept empty(null value not accepted)

    Its importance are:

    • It uniquely identifies records.
    • It prevents duplication of data.
    • It helps in faster searching of records.

    Ans: Arranging data in a particular order of field that may be either ascending or descending is called data sorting. The process of placing elements from a collection in some kind of order is sorting. Its advantages are:

    • Similar data can be grouped together.
    • It helps in faster searching of data.

    Ans: Form allows user to enter new data and edit or modify the existing data through user friendly interface. Query allows user to retrieve or access and interpret the information based on the user requirements.

    DECLARE SUB SHOW (A)
    CLS
    N = 87
    CALL SHOW (N)
    END
    SUB SHOW (A)
    DO
    B = A MOD 6 + 3
    IF B MOD 4 = 0 THEN
    GOTO AA
    PRINT B;
    AA:
    A = A - 10
    LOOP WHILE A >= 50
    END SUB

    Ans:

    Dry run in table
     ANB = A MOD 6+3Condition(B MOD 4 = 0)
     87
     8787
    1st loop77876false
    2nd loop67874true
    3rd loop57876false
    4th loop47878true

    Output is: 6 6

    REM to add record in an existing file
    CLS
    OPEN “Record.Dat” FOR OUTPUT AS #1
    AA:
    INPUT “Enter Name, Class and Roll No. “; Nm$, Cl, Rn
    INPUT #2, Nm$, Cl, Rn
    INPUT “More records “; Y$
    IF UCASE$(Y$) = “Y” THEN
    GOTO aa
    CLOSE “Record.dat”
    END

    Ans: Program after correcting bugs is:

    CLS
    OPEN “Record.Dat” FOR APPEND AS #1
    AA:
    INPUT “Enter Name, Class and Roll No. “; Nm$, Cl, Rn
    WRITE #1, Nm$, Cl, Rn
    INPUT “More records “; Y$
    IF UCASE$(Y$) = “Y” THEN
    GOTO aa
    CLOSE #1
    END
    OPEN “Detail.dat” FOR INPUT AS #1
    OPEN “Temp.dat” FOR OUTPUT AS #2
    INPUT “Enter name of the students “; Sn$
    FOR I = 1 TO 10
    INPUT #1, Nm$, Cl, A
    IF Sn$ < > Nm$ THEN
    WRITE #2, Nm$, Cl, A
    END IF
    NEXT I
    CLOSE #1, #2
    KILL “Detail.dat”
    NAME “Temp.dat” AS “Detail.dat”
    END
    • What is the main objective of the program given above?

    Ans: The main objective of given program is to delete the record associated with the name entered by the user.

    • Do you get any problem in the above program if “Kill” statement is removed? Give reason.

    Ans: Since, KILL statement will delete datafile named “detail.dat”, if we removed KILL the new data file “temp.dat” will be not renamed as “detail.dat”

    • (11001101)2 = (?)16
    • (524)10 = (?)2
    • (1010)2 x (110)2 – (1011)2 = (?)2
    • (10110)2 ÷ (101)2

    Ans:

    1. Convert (11001101)2to hexadecimal ((?)16:

    First, let’s group the binary digits into sets of four, starting from the right: 1100 11011100 1101

    Now, convert each group to its hexadecimal equivalent:

    • 11001100 in binary is 1212 in decimal, which is 𝐶C in hexadecimal.
    • 11011101 in binary is 1313 in decimal, which is 𝐷D in hexadecimal.

    Thus, (11001101)2=(𝐶𝐷)16(11001101)2​=(CD)16​.

    2. Convert (524)10​ to binary ((?)2​):

    To convert from decimal to binary, we repeatedly divide by 2 and record the remainders.

    524 ÷ 2 = 262 remainder 0
    262 ÷ 2 = 131 remainder 0
    131 ÷ 2 = 65 remainder 1
    65 ÷ 2 = 32 remainder 1
    32 ÷ 2 = 16 remainder 0
    16 ÷ 2 = 8 remainder 0
    8 ÷ 2 = 4 remainder 0
    4 ÷ 2 = 2 remainder 0
    2 ÷ 2 = 1 remainder 0
    1 ÷ 2 = 0 remainder 1

    Reading the remainders from bottom to top, (524)10=(1000001100)2(524)10​=(1000001100)2​.

    3. Calculate (1010)2×(110)2−(1011)2​:

    First, let’s perform the multiplication: (1010)2×(110)2(1010)2​×(110)2​

    Convert to decimal to make multiplication easier:

    • (1010)2=10(1010)2​=10 in decimal.
    • (110)2=6(110)2​=6 in decimal.

    Now, multiply the decimal numbers: 10×6=6010×6=60

    Convert 6060 back to binary: 60 ÷ 2 = 30 remainder 0
    30 ÷ 2 = 15 remainder 0
    15 ÷ 2 = 7 remainder 1
    7 ÷ 2 = 3 remainder 1
    3 ÷ 2 = 1 remainder 1
    1 ÷ 2 = 0 remainder 1

    Thus, 6010=(111100)26010​=(111100)2​.

    Now, subtract (1011)2(1011)2​ from (111100)2(111100)2​: First, align the numbers: 111100111100 −001011−001011

    Perform binary subtraction: 111100−001011=110001111100−001011=110001

    So, (1010)2×(110)2−(1011)2=(110001)2(1010)2​×(110)2​−(1011)2​=(110001)2​.

    4. Perform the division (10110)2÷(101)2​:

    Convert the numbers to decimal:

    • (10110)2=22(10110)2​=22 in decimal.
    • (101)2=5(101)2​=5 in decimal.

    Now, divide the decimal numbers: 22÷5=4 remainder 222÷5=4 remainder 2

    Convert the quotient and remainder back to binary:

    • 410=(100)2410​=(100)2​
    • 210=(10)2210​=(10)2​

    Thus, the division (10110)2÷(101)2=(100)2(10110)2​÷(101)2​=(100)2​ with a remainder of (10)2(10)2​.

    In summary:

    1. (11001101)2=(𝐶𝐷)16
    2. (524)10=(1000001100)2
    3. (1010)2×(110)2−(1011)2=(110001)2
    4. (10110)2÷(101)2=(100)2​ with a remainder of (10)2​.

    Ans:

    DECLARE FUNCTION area(l, b)
    DECLARE SUB volume(l, b, h)
    CLS
    INPUT “Enter length breadth and height”, l, b, h
    x=area(l, b)
    PRINT “Area is”; x
    CALL volume(l, b, h)
    END
    FUNCTION area(l, b)
    a=l*b
    area=a
    END FUNCTION
    SUB volume(l, b, h)
    v=l*b*h
    PRINT “Volume is”; v
    END SUB

    Ans:

    OPEN “Record.txt” FOR INPUT AS #1
    CLS
    PRINT “Roll No”, “Name”, “Gender”, “English”, “Nepali”, “Maths”, “Computer”
    WHILE NOT EOF(1)
    	INPUT #1, r, n$, g$, e, n, m, c
    	g$ = UCASE$(g$)
    	IF g$ = “F” AND c>90 THEN
    		PRINT r, n$, g$, e, n, m, c
    	END IF
    WEND
    CLOSE #1
    END

    Ans:

    #include
    int main( )
    {
    	int n, a;
    	printf(“Enter any number”);
    	scanf(“%d”, &n);
    	a = n%2;
    	if (a == 0)
    	{
    		printf(“%d is even”, n);
    	}
    	else
    	{
    		printf(“%d is odd”, n);
    	}
    	return 0;
    }

    Ans:

    #include
    int main( )
    {
    	int i, s=0;
    	for(i=1; i<=10; i++)
    	{
    		printf(“%d”, i);
    		s = s+i;
    	}
    	printf(“Sum is %d”, s);
    	return 0;
    }

    How can we help?

    Leave a Reply

    Your email address will not be published. Required fields are marked *