1.Distinguish between a WHILE loop and a DO-WHILE loop control structure as used in programming. (2 Marks) 2.diffrentiate between impact and non-impact printers and give example of each 3.two function of cpu 4.convert binary number 110101 to decimal 5.convert decimal 45 to binary ,show working 6.add the binary numbers 1011 and 1101 7.differentiate between ram and rom .one item stored in rom 8.define primary key as used in database 9.write a spreadsheet to find average of values in cell b2-b10 . differentiate between absolute and relative cell referencing 10.differentiate between LAN and WAN 11.two advantages of star network topology 12.two ways of protecting data and information from unauthorized sources 13.what is computer virus .two ways of preventibg virus infection 14.differentiate between syntax and logic error 15.write full meaning of the following .url .http .isp Ict 16.define the term algorithm and state two characteristics of a good algorithm .a teacher wants a program that reads marks of 40 students,counts the students who scored 50 or more, and then displays the no. Of passes and pass percentage . Write a pseudo code for the program .state the shape and purpose of two flow chart symbols 18.define computer network .three advantages of networking computers . describe star topology and 1 disadvantage of it .state four services provided by the internet . differentiate between intranet and extranet 19.define data entry .four threats to data and inormation in computer system .explain 3 physical security measures that can be used to protect a computer laboratory .state three ways of reducing health problem when using a computers Section B ndo hizo tatu 45 marks

Computer Science

ScanSolve AI Answer

Answers

4 parts
4
53
5

1011012101101_2

6

11000211000_2

9

=AVERAGE(B2:B10)\text{=AVERAGE(B2:B10)}

Step-by-step solution

6 steps

Part 1

1. Distinguish between a WHILE loop and a DO-WHILE loop control structure as used in programming.

A WHILE loop checks its condition before executing the loop body, meaning the body might not execute at all if the condition is initially false. A DO-WHILE loop executes its loop body at least once before checking the condition, meaning the body is guaranteed to execute at least one time.


Part 2

2. Differentiate between impact and non-impact printers and give example of each.

Impact printers create an image by physically striking an ink ribbon against the paper. An example is a dot-matrix printer. Non-impact printers create an image without any physical contact between the print head and the paper, often using ink spray or toner. Examples include inkjet printers and laser printers.


Part 3

3. Two functions of CPU.

  1. Executes instructions: The CPU fetches, decodes, and executes program instructions.
  2. Performs arithmetic and logical operations: It carries out calculations (addition, subtraction, etc.) and makes comparisons (greater than, equal to, etc.).

Part 453

4. Convert binary number 110101 to decimal.

  1. Assign positional weights.

    The binary number 110101 has digits at positions 25,24,23,22,21,202^5, 2^4, 2^3, 2^2, 2^1, 2^0.

  2. Multiply each binary digit by its corresponding positional weight.

    (1×25)+(1×24)+(0×23)+(1×22)+(0×21)+(1×20)(1 \times 2^5) + (1 \times 2^4) + (0 \times 2^3) + (1 \times 2^2) + (0 \times 2^1) + (1 \times 2^0) (1×32)+(1×16)+(0×8)+(1×4)+(0×2)+(1×1)(1 \times 32) + (1 \times 16) + (0 \times 8) + (1 \times 4) + (0 \times 2) + (1 \times 1) 32+16+0+4+0+132 + 16 + 0 + 4 + 0 + 1
  3. Sum the results.

    32+16+4+1=5332 + 16 + 4 + 1 = 53

    The decimal equivalent of 110101 is 53.


Part 5

1011012101101_2

5. Convert decimal 45 to binary, show working.

  1. Divide the decimal number by 2 and record the remainder.

    45÷2=22 remainder 145 \div 2 = 22 \text{ remainder } 1 22÷2=11 remainder 022 \div 2 = 11 \text{ remainder } 0 11÷2=5 remainder 111 \div 2 = 5 \text{ remainder } 1 5÷2=2 remainder 15 \div 2 = 2 \text{ remainder } 1 2÷2=1 remainder 02 \div 2 = 1 \text{ remainder } 0 1÷2=0 remainder 11 \div 2 = 0 \text{ remainder } 1
  2. Read the remainders from bottom to top.

    The binary equivalent of 45 is 101101_2.


Part 6

11000211000_2

6. Add the binary numbers 1011 and 1101.

  1. Align the numbers and add column by column from right to left, carrying over when the sum is 2 or more.

      1011
    + 1101
    ------
    
    • Rightmost column: 1+1=1021 + 1 = 10_2 (0 with a carry of 1)
    • Second column from right: 1 (carry) +1+0=102+ 1 + 0 = 10_2 (0 with a carry of 1)
    • Third column from right: 1 (carry) +0+1=102+ 0 + 1 = 10_2 (0 with a carry of 1)
    • Leftmost column: 1 (carry) +1+1=112+ 1 + 1 = 11_2 (1 with a carry of 1, which becomes the leading digit)
      1 1 1  (Carries)
      1011
    + 1101
    ------
     11000
    

    The sum of 1011 and 1101 is 11000_2.


Part 7

7. Differentiate between RAM and ROM. One item stored in ROM.

RAM (Random Access Memory) is volatile memory, meaning its contents are lost when the power is turned off. It is used for temporary storage of data and programs that the CPU is actively using, and it can be both read from and written to. ROM (Read-Only Memory) is non-volatile memory, meaning its contents are retained even when the power is off. It typically stores permanent instructions and data that are essential for the computer's basic operation and is generally only readable.

One item stored in ROM is the BIOS (Basic Input/Output System) or firmware that starts up the computer.


Part 8

8. Define primary key as used in database.

A primary key is a special relational database table column (or combination of columns) designated to uniquely identify each record (row) in that table. It must contain unique values for each row and cannot contain NULL values.


Part 9

=AVERAGE(B2:B10)\text{=AVERAGE(B2:B10)}

9. Write a spreadsheet to find average of values in cell b2-b10. Differentiate between absolute and relative cell referencing.

To find the average of values in cells B2 to B10, the spreadsheet formula is:
=AVERAGE(B2:B10)

Relative cell referencing refers to a cell's position relative to the cell containing the formula. When a formula with relative references is copied to another cell, the references automatically adjust based on the new position. For example, if =A1+B1 in C1 is copied to C2, it becomes =A2+B2.

Absolute cell referencing refers to a specific cell address that does not change when the formula is copied to other cells. This is achieved by placing a dollar sign $ before the column letter and/or row number (e.g., $A$1). For example, if =$A$1+B1 in C1 is copied to C2, it becomes =$A$1+B2.


Part 10

10. Differentiate between LAN and WAN.

A LAN (Local Area Network) connects computers and devices within a limited geographical area, such as a home, office building, or campus. A WAN (Wide Area Network) connects computers and devices over a large geographical area, spanning cities, countries, or even continents, often using public telecommunication lines.


Part 11

11. Two advantages of star network topology.

  1. Easy fault isolation: If one cable or device fails, only that segment is affected, and the rest of the network continues to function.
  2. Easy to add/remove nodes: New devices can be added to the central hub without disrupting the entire network.

Part 12

12. Two ways of protecting data and information from unauthorized sources.

  1. Access Control (e.g., Passwords, User IDs): Restricting access to data by requiring authentication credentials.
  2. Encryption: Transforming data into a coded format to prevent unauthorized access, making it unreadable without the correct decryption key.

Part 13

13. What is computer virus. Two ways of preventing virus infection.

A computer virus is a type of malicious software (malware) that, when executed, replicates itself by modifying other computer programs and inserting its own code. When this replication succeeds, the affected areas are then said to be "infected."

Two ways of preventing virus infection:

  1. Install and regularly update antivirus software: Antivirus programs can detect, prevent, and remove malicious software.
  2. Be cautious with email attachments and downloads: Avoid opening suspicious attachments or downloading files from untrusted sources.

Part 14

14. Differentiate between syntax and logic error.

A syntax error occurs when the code violates the grammatical rules of the programming language (e.g., a missing semicolon, misspelled keyword). The program will not compile or run until syntax errors are corrected. A logic error occurs when the program runs without crashing but produces incorrect or unexpected output because of a flaw in the program's algorithm or reasoning (e.g., using addition instead of subtraction, incorrect loop conditions).


Part 15

15. Write full meaning of the following: URL, HTTP, ISP, ICT.

  • URL: Uniform Resource Locator
  • HTTP: Hypertext Transfer Protocol
  • ISP: Internet Service Provider
  • ICT: Information and Communication Technology

Question 16: 16. Define the term algorithm and state two characteristics of a good algorithm. A teacher wants a program that reads marks of 40 students, counts the students who scored 50 or more, and then displays the no. Of passes and pass percentage. Write a pseudo code for the program. State the shape and purpose of two flow chart symbols.

An algorithm is a finite set of well-defined, unambiguous instructions for accomplishing a specific task or solving a problem.

Two characteristics of a good algorithm:

  1. Finiteness: It must terminate after a finite number of steps.
  2. Unambiguity: Each step must be clear and have only one interpretation.

Pseudocode for the program:

START
    SET totalStudents = 40
    SET passCount = 0
    SET studentCounter = 1

    WHILE studentCounter <= totalStudents
        DISPLAY "Enter marks for student " + studentCounter
        READ studentMarks

        IF studentMarks >= 50 THEN
            INCREMENT passCount
        END IF

        INCREMENT studentCounter
    END WHILE

    CALCULATE passPercentage = (passCount / totalStudents) * 100

    DISPLAY "Number of students who passed: " + passCount
    DISPLAY "Pass percentage: " + passPercentage + "%"
END

Two flowchart symbols:

  1. Shape: Oval (or rounded rectangle) Purpose: Represents the start or end point of a program or process (Terminator).
  2. Shape: Rectangle Purpose: Represents a process or action step (e.g., calculations, data manipulation).

Question 17: 18. Define computer network. Three advantages of networking computers. Describe star topology and 1 disadvantage of it. State four services provided by the internet. Differentiate between intranet and extranet.

A computer network is a collection of interconnected computers and other devices that can share resources, data, and applications.

Three advantages of networking computers:

  1. Resource Sharing: Users can share hardware (e.g., printers, scanners) and software resources.
  2. Data Sharing and Collaboration: Easy exchange of files and information, facilitating teamwork.
  3. Centralized Management: Easier to manage and back up data, and to install software updates from a central location.

Star topology is a network arrangement where every node (computer or device) is individually connected to a central hub, switch, or server. All data passes through this central device.
One disadvantage of star topology is that if the central hub or switch fails, the entire network goes down.

Four services provided by the Internet:

  1. World Wide Web (WWW): Access to websites and web-based information.
  2. Email: Electronic mail for sending and receiving messages.
  3. File Transfer (FTP): Transferring files between computers.
  4. Online Communication: Instant messaging, video conferencing, social media.

Intranet is a private network accessible only to an organization's employees, typically used for internal communication, collaboration, and resource sharing. It uses Internet technologies but is restricted to authorized users within the organization. An Extranet is an extension of an intranet that allows controlled access to authorized external users (e.g., customers, vendors, partners) to specific parts of the organization's intranet. It facilitates secure business-to-business communication and data exchange.


Question 18: 19. Define data entry. Four threats to data and information in computer system. Explain 3 physical security measures that can be used to protect a computer laboratory. State three ways of reducing health problem when using a computers.

Data entry is the process of converting information from a physical format (like paper documents) or another digital format into a computer system, typically by typing, scanning, or using other input methods.

Four threats to data and information in a computer system:

  1. Malware (Viruses, Ransomware, Spyware): Malicious software designed to damage, disrupt, or gain unauthorized access to computer systems.
  2. Unauthorized Access/Hacking: Gaining access to systems or data without permission, often for malicious purposes.
  3. Data Loss/Corruption: Accidental deletion, hardware failure, software bugs, or natural disasters leading to loss or damage of data.
  4. Phishing/Social Engineering: Deceptive tactics used to trick individuals into revealing sensitive information or performing actions that compromise security.

Three physical security measures to protect a computer laboratory:

  1. Access Control Systems: Implementing locked doors, keycard access, biometric scanners (fingerprint, retina) to restrict entry to authorized personnel only.
  2. Surveillance Systems: Installing CCTV cameras to monitor the laboratory premises, deter theft, and record any unauthorized activities.
  3. Environmental Controls: Using fire suppression systems (e.g., sprinklers, gas suppression), temperature and humidity controls to protect equipment from environmental damage.

Three ways of reducing health problems when using computers:

  1. Maintain Proper Ergonomics: Use an adjustable chair, position the monitor at eye level, keep wrists straight, and ensure proper posture to prevent musculoskeletal disorders.
  2. Take Regular Breaks: Follow the 20-20-20 rule (every 20 minutes, look at something 20 feet away for 20 seconds) to reduce eye strain, and take short breaks to stretch and move around to prevent stiffness and fatigue.
  3. Adjust Screen Settings: Optimize screen brightness, contrast, and font size to reduce eye strain, and use anti-glare filters if necessary.
Was this helpful?

Try one yourself

A new problem that tests the same skill.

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question