0% found this document useful (0 votes)
2 views

Computer

The document discusses various aspects of HTML and programming languages, including the roles of closing tags, bgcolor attributes, and the use of comments. It also covers different generations of programming languages, their features, and comparisons between them, as well as the differences between compilers and interpreters. Additionally, it includes examples of arithmetic and logical operators, pseudocode, and true/false statements regarding programming concepts.

Uploaded by

vickypatel1980
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Computer

The document discusses various aspects of HTML and programming languages, including the roles of closing tags, bgcolor attributes, and the use of comments. It also covers different generations of programming languages, their features, and comparisons between them, as well as the differences between compilers and interpreters. Additionally, it includes examples of arithmetic and logical operators, pseudocode, and true/false statements regarding programming concepts.

Uploaded by

vickypatel1980
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1. Closing Tags do not have attributes mentioned in them.

Ans.: Disagree Closing tags do not contain attributes.


Closing tags simply mark the end of an HTML element. They serve a
structural purpose, indicating where a particular element's content ends.
Attributes, on the other hand, provide additional information about an
element, such as its style, ID, or class. They are always associated with
opening tags.
The syntax of a closing tag is simply the element name enclosed in angle
brackets preceded by a forward slash (e.g., </p> for a paragraph).

2: Bgcolor displays the background Images in a specified colour.


Ans.: Disagree bgcolor sets the background color, not an image.
The bgcolor attribute is an outdated HTML attribute used to set the
background color of an element. It's deprecated and should not be used
in modern HTML.
To set a background image, you should use CSS, specifically
the background-image property within a <style> tag or an external
stylesheet.

3. <p> is useful in breaking the content in readable chunks.


Ans.: Agree <p> creates line paragraph, aiding readability.
The <p> HTML element represents a paragraph. Paragraphs are usually
represented in visual media as blocks of text separated from adjacent
blocks by blank lines and/or first-line indentation, but HTML paragraphs
can be any structural grouping of related content, such as images or form
fields.

4. <Font> can display text in any size


Ans.: Agree <Font> allows text to be displayed in various sizes.
HTML, through CSS, offers extensive control over text size. The <font
size="..."> tag (deprecated) and CSS properties like font-size allow you to
specify text size in various units (pixels, ems, rems, etc.).

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

2. Which of the following languages encouraged common people to take up


programming?
c. High-level languages

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

4. Integer, float, character, string-these are the examples of which of the


following?
d. Data type

5. Richa wrote a pseudocode for the program to calculate students' test


percentage. Her pseudocode is based on which of the following
programming languages?
d. None of these

B. Fill in the blanks.


1. NOT logical operator reverses the given condition.
2. Clicking a button with a mouse is an example of an Event.
3. SQL is an example of a fourth-generation computer language.
4. Least programming skills are needed in using Fourth generation computer
language.
5. A large program can be divided into smaller Modules.

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.

3. How is a compiler different from an interpreter?


Ans.: A compiler translates the entire source code of a program into machine
code (or an intermediate representation) before the program is executed.
The resulting machine code can then be run directly by the computer.
Compilers generally produce faster-running programs.
An interpreter translates and executes the source code line by line,
without creating a separate machine code file. Interpreted programs
typically run slower than compiled programs, but they are often easier to
debug because errors are identified during execution.

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.

Pseudocode to calculate the perimeter of a rectangle:


BEGIN
INPUT length
INPUT width
perimeter = 2 * (length + width)
OUTPUT perimeter
END

Investigate Information and Establish Facts


Identify the following statements as true or false. Find out the true fact about
the false statements.

1. Compiler lets execute a program even if it has some errors.


Ans.: False
A compiler does not compile the program line by line. It compiles the
whole source code into machine code at once. Any error in the source
code can be detected only after the program is has been compiled and it
will not allow the program to execute until the source code is corrected.

2. Display student_names where not (marks<60) will display students who


secured more than 60.
Ans.: True
As per code student_names where not (marks < 60), it will filter the record
and hide all the student_names marks who have less than 60 and it will
display all the other records who are greater than 60.

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.

4. A pseudocode can be run on any computer.


Ans.: False
Pseudocode itself cannot be run or executed like actual programming
code because it is not written in any specific programming language that
a computer can interpret.
5. Logical operators evaluate more than one condition.

111

You might also like