1. Home
  2. Docs
  3. Model Question solution(S...
  4. Computer Science
  5. Model Questions Solution (IV)

Model Questions Solution (IV)

Ans: The internet is a global network of interconnected computers that communicate using standardized protocols to share information and resources.

Ans: Cloud computing is the delivery of computing services such as storage, processing, and software over the internet, allowing for on-demand access and scalability.

Ans: The Currency data type is used to store the salary of an employee in MS-Access.

Ans: The extension of an MS-Access database is .accdb.

Ans: Modules in QBASIC are blocks of code or procedures that can be called from other parts of the program to perform specific tasks.

Ans: Two data types used in C language are int and float.

Ans: Bandwidth

Ans: Virtual Reality (VR)

SMTP, CDMA

Ans: SMPT: Simple Mail Transfer Protocol

CDMA: Code Division Multiple Access

Ans: Bus topology connects all devices in a linear sequence with a single central cable (bus), whereas star topology connects all devices to a central hub or switch, forming a star-like structure.

Ans: Computer crime, also known as cybercrime, refers to illegal activities conducted using computers or networks. Four examples are hacking, phishing, identity theft, and the spread of malware.

Ans: Hardware security involves protecting physical computer systems from damage and unauthorized access. Two measures of software security are using antivirus programs and implementing strong, unique passwords.

Ans: E-Commerce, or electronic commerce, is the buying and selling of goods and services over the internet. Its importance includes enabling businesses to reach a global audience, reducing operational costs, and providing convenience to consumers.

Ans: Mobile computing is the ability to use computing capabilities on the move, typically through devices like smartphones and tablets. Its importance includes increased accessibility to information and the ability to perform tasks from virtually anywhere.

Ans: A database is an organized collection of data, whereas a DBMS (Database Management System) is software that interacts with users, applications, and the database itself to capture and analyze data. For example, an Excel spreadsheet is a database, while Microsoft Access is a DBMS.

Ans: A primary key is a unique identifier for records in a database table. Two advantages are ensuring each record is unique and improving data retrieval speed.

Ans: Data sorting is the process of arranging data in a specific order, such as ascending or descending. Two advantages are easier data analysis and faster search and retrieval of information.

Ans: A query is a request for data or information from a database. Its importance lies in its ability to filter, sort, and retrieve specific data efficiently from large datasets.

DECLARE SUB SHOW (A,B) 
CLS
X=1 : Y=2
CALL SHOW (X,Y) 
END 
SUB SHOW (A ,B) 
I=1
DO 
PRINT A;
A=A+B
B=A+B
I=I+1
LOOP WHILE I <= 5
END SUB

Ans:

Dry Run Table:

IterationIA (Initial)B (Initial)A (New)B (New)Output
1112351
22358133
3381321348
442134558921
55558914423355

Output:

1 3 8 21 55
REM to store record in data file
CLS 
OPEN “info.dat” FOR INPUT AS #1 
DO
INPUT “Enter Name, address and class “; N$, A, C 
INPUT #1, N$, A, C
 INPUTDo you want to continue “; Y$
WHILE UCASE$(Y$) = “Y
CLOSEinfo.dat
END

Ans: Here is the corrected version of the program:

REM to store record in data file
CLS 
OPEN "info.dat" FOR APPEND AS #1
DO
  INPUT "Enter Name: ", N$
  INPUT "Enter Address: ", A$
  INPUT "Enter Class: ", C
  WRITE #1, N$, A$, C
  INPUT "Do you want to continue (Y/N)? ", Y$
LOOP WHILE UCASE$(Y$) = "Y"
CLOSE #1
END
DECLARE FUNCTION text$(N$)
CLS
INPUT “Enter any string”;X$
PRINT text$(X$)
END
FUNCTION text$(N$)
            FOR i=len (N$) TO 1 STEP -1
                        W$=W$+MID$(N$,I,1)
            NEXT i
            text$ = W$
END FUNCTION

Ans: The main objective of the program is to reverse the input string entered by the user.

Ans: The parameters used in the program are N$ (the input string passed to the function) and X$ (the input string entered by the user).

  1. (1110001110)2 = (?)8
  2. (111)10 = (?) 2
  3. (1000) 2 – (111) 2 = (?) 2
  4. (111111) 2 ÷ (111) 2

Ans:

1. Convert (1110001110)2​ to (?)8​To convert binary (base-2) to octal (base-8), group the binary digits into sets of three, starting from the right.

Binary: 1 110 001 110

| | | |

Octal: 1 6 1 6

So, (1110001110)2​ = (1616)8

2. Convert (111)10 to (?)2

To convert from decimal (base-10) to binary (base-2), divide the number by 2 and write down the remainder. Continue dividing the quotient by 2 until you get a quotient of 0.

    111 ÷ 2 = 55 remainder 1
    55 ÷ 2 = 27 remainder 1
    27 ÷ 2 = 13 remainder 1
    13 ÷ 2 = 6 remainder 1
    6 ÷ 2 = 3 remainder 0
    3 ÷ 2 = 1 remainder 1
    1 ÷ 2 = 0 remainder 1
    

    Read the remainders from bottom to top: 1101111

    So, (111)10 = (1101111)2

    3. Calculate (1000)2​ – (111)2

    To subtract binary numbers, align them and perform binary subtraction.

        1000
      -  0111
      ------
        0001
      

      So, (1000)2- (111)2= (1)2

      4. Calculate (111111)2​ ÷ (111)2 To divide binary numbers, perform binary division similar to decimal division.

          1001
        ------
        111 ) 111111
               111
               ----
                 000
                 000
                 ----
                 0000
                 0000
                 ----
                 0000
        

        So, (111111)2 ÷ (111)2 = (1001)2

        Ans: QBASIC Program to Calculate Area and Circumference of a Circle:

        DECLARE FUNCTION CalculateArea (radius)
        DECLARE SUB CalculateCircumference (radius)
        
        CLS
        INPUT "Enter the radius of the circle: ", radius
        PRINT "The area of the circle is: "; CalculateArea(radius)
        CALL CalculateCircumference(radius)
        END
        
        FUNCTION CalculateArea (radius)
            CalculateArea = 3.14159 * radius * radius
        END FUNCTION
        
        SUB CalculateCircumference (radius)
            circumference = 2 * 3.14159 * radius
            PRINT "The circumference of the circle is: "; circumference
        END SUB
        

        Ans: QBASIC Program to Display Information of Female Students Who Pass in All Subjects:

        OPEN "Record.txt" FOR INPUT AS #1
        CLS
        PRINT "Female Students Who Passed in All Subjects"
        PRINT "------------------------------------------"
        
        DO WHILE NOT EOF(1)
            INPUT #1, RollNo, Name, Gender, English, Nepali, Maths, Computer
            IF Gender = "F" AND English >= 40 AND Nepali >= 40 AND Maths >= 40 AND Computer >= 40 THEN
                PRINT "Roll No: "; RollNo; " Name: "; Name; " Gender: "; Gender
                PRINT "English: "; English; " Nepali: "; Nepali; " Maths: "; Maths; " Computer: "; Computer
                PRINT
            END IF
        LOOP
        
        CLOSE #1
        END
        

        Ans: C Program to Convert Days into Years, Months, and Days:

        #include <stdio.h>
        
        int main() {
            int totalDays, years, months, days;
            printf("Enter the number of days: ");
            scanf("%d", &totalDays);
        
            years = totalDays / 365;
            totalDays = totalDays % 365;
            months = totalDays / 30;
            days = totalDays % 30;
        
            printf("Years: %d, Months: %d, Days: %d\n", years, months, days);
            return 0;
        }
        

        Ans: C Program to Find the Greatest of Two Numbers:

        #include <stdio.h>
        
        int main() {
            int num1, num2;
            printf("Enter the first number: ");
            scanf("%d", &num1);
            printf("Enter the second number: ");
            scanf("%d", &num2);
        
            if (num1 > num2) {
                printf("The greatest number is: %d\n", num1);
            } else if (num2 > num1) {
                printf("The greatest number is: %d\n", num2);
            } else {
                printf("Both numbers are equal.\n");
            }
            
            return 0;
        }
        

        How can we help?

        Leave a Reply

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