COMPUTER 2 Flashcards

(12 cards)

1
Q

What are the two main aspects of software designing?

A

Program Structure and Program Representation

Program Structure refers to how a program should be organized, while Program Representation refers to its presentation style for readability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the importance of programming style?

A

Developing a good program is a skill; writing a good program is a quality habit.

Effective programming style enhances readability and maintainability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List the guidelines for making a program readable.

A
  • Use of proper names for identifiers
  • Clarity of expressions
  • Use comments and indentation
  • Insert blank lines and spaces
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What should be considered when using proper names for identifiers?

A

Assign meaningful names to variables, constants, and functions. Avoid similar-looking names.

Examples include avg_marks, total_salary, roll_number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can clarity of expressions be improved?

A

Use parentheses to enclose subexpressions.

This enhances readability and understanding of the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of using comments and indentation in programming?

A

To provide internal documentation that is ignored by the compiler.

Example: //Program to add.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is inserting blank lines and spaces beneficial?

A

It enhances the program’s readability.

Good formatting helps others understand the code better.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is pretty printing in programming?

A

The process of converting and presenting source code in a legible and attractive way.

It improves the visual structure of the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the characteristics of a good program?

A
  • Efficient and effective
  • User friendly
  • Self-documenting code
  • Reliable
  • Portable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a syntax error?

A

Occurs when the rules of programming are misused, violating grammatical rules of the programming language.

Example: Incorrect use of syntax in C++.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a logical error?

A

Occurs when a program compiles and runs but does not produce the correct result due to a programmer’s mistake in analysis.

These errors can be difficult to detect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a runtime error?

A

Errors that occur during the execution of a program.

These can cause the program to crash or behave unexpectedly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly