Computer
Computer
101
5. Comments are not visible in browser so they are useless.
Ans. Disagree Comments are not visible in the browser but are useful for
developers.
HTML comments (<!-- comment here -->) are ignored by the browser
during rendering. They are not displayed to the user.
However, comments are extremely useful for developers to add notes,
explanations, or reminders within the code. They improve code readability
and maintainability, especially in larger projects.
101
A. Choose the correct answer.
1. Which of the following languages is fastest in execution and takes least
memory?
b. Machine language
3. Rajan wrote a program and the translator does not allow him to run the
program unless all the errors are removed. Which type of translator is
this?
b. Compiler
110
C. Answer the following questions.
1. List the examples and one unique feature of each of the computer
language generation.
Ans.: First Generation (Machine Language):
Example: Binary code (0s and 1s).
Unique Feature: Directly understood by the computer's hardware; very
low-level and difficult to program.
Second Generation (Assembly Language):
Example: Assembly code using mnemonics (e.g., ADD, MOV).
Unique Feature: Uses symbolic instructions, making programming slightly
easier than machine language, but still requires a low-level understanding
of the hardware.
Third Generation (High-Level Languages):
Examples: C, C++, Java, Pascal.
Unique Feature: More abstract and human-readable than lower-level
languages; uses more complex syntax and structures, allowing for faster
development.
Fourth Generation (Very High-Level Languages):
Examples: SQL, MATLAB, RPG.
Unique Feature: Focuses on specific tasks or domains; often uses
declarative programming, specifying what to do rather than how to do it.
Fifth Generation (Artificial Intelligence Languages):
Examples: Prolog, Lisp.
Unique Feature: Designed for artificial intelligence applications; often uses
logic programming or declarative paradigms.
110
2. Compare Third and Second generations of computer languages briefly.
Ans.: Second-generation languages (assembly languages) are low-level,
requiring programmers to understand the computer's architecture and
use mnemonics representing machine instructions. Third-generation
languages (high-level languages) are more abstract and human-readable,
using English-like syntax and structures. Third-generation languages
significantly reduce the complexity of programming compared to second-
generation languages, making development faster and easier. Third-
generation languages are also more portable across different computer
architectures.
4. Describe the use of any 2 arithmetic operators and logical operators each.
Ans.: Arithmetic Operators:
1. Addition (+): This operator adds two or more numerical values together.
For example, x + y adds the values of variables x and y.
2. Multiplication (*): This operator multiplies two or more numerical values.
For example, area = length * width calculates the area of a rectangle.
Logical Operators:
1. AND: This operator returns true only if both operands are true. For
example, (age > 18) AND (license == true) checks if a person is both over
18 and has a driver's license.
2. OR: This operator returns true if at least one of the operands is true. For
example, (temperature > 25) OR (humidity > 80) checks if the temperature
is above 25 degrees or the humidity is above 80%.
110
5. What is a pseudocode? Write a pseudocode to calculate the perimeter of
a rectangle by accepting its length and width from the user.
Ans.: A pseudocode is an informal, high-level description of an algorithm or a
computer program. It uses natural language mixed with programming-like
constructs to outline the steps involved without adhering to the strict
syntax of any specific programming language. It's a tool to plan and design
a program before writing the actual code.
111
3. Machine language programs do not need translators for computer.
Ans.: True
Machine language is the only language directly understood by computers,
representing instructions in zeros and ones.
111