LONG ANSWER TYPE QUESTIONS
1. What is a flowchart? Explain different symbols in a flowchart.
Ans:- A flowchart is a graphical representation of an algorithm or a process using different symbols and arrows to indicate the flow of execution. It helps in understanding the logic of a program and serves as a tool for designing and analyzing complex processes.
Different symbols used in a flowchart:
- Terminator Symbol (Oval): Represents the start and end of a flowchart.
- Process Symbol (Rectangle): Represents a process, operation, or action to be performed.
- Decision Symbol (Diamond): Used to represent decision-making conditions with Yes/No or True/False outcomes.
- Input/Output Symbol (Parallelogram): Represents input (user data entry) and output (result display).
- Connector Symbol (Circle): Used to connect different parts of a flowchart when it continues to another location.
- Arrow Lines: Indicate the flow direction of the process.
Flowcharts are widely used for planning, troubleshooting, and documenting processes. They make complex algorithms easy to understand and help in debugging errors efficiently.
2. What is pseudo code and algorithm?
Ans:- An algorithm is a step-by-step procedure or set of instructions to solve a problem systematically. It consists of well-defined operations and follows a specific order to reach a solution. Algorithms are the foundation of programming and can be written in simple English or mathematical notation.
A pseudo code is a simplified, human-readable representation of an algorithm that resembles programming language syntax but does not follow strict coding rules. It serves as a bridge between the algorithm and actual code, helping programmers plan their logic before implementation.
Example:
Algorithm to add two numbers:
- Start
- Read two numbers A and B
- Compute Sum = A + B
- Print Sum
- Stop
Pseudo code:
BEGIN
Pseudo code improves clarity and helps developers convert logic into actual programming language efficiently.
3. What is top-down and bottom-up approach? Explain.
Ans:- Top-down and bottom-up are two common approaches to problem-solving and program design.
Top-down approach:
- Starts with a broad, general overview of the system.
- Breaks the problem into smaller sub-problems (modules).
- Each module is further divided until the smallest task is achieved.
- Example: Writing the main function first and then defining sub-functions.
Bottom-up approach:
- Begins with solving the most basic or lowest-level tasks first.
- Small functions/modules are created first and then integrated to form the complete system.
- Example: Creating helper functions first and then integrating them into the main function.
Both approaches are used in software development depending on the problem complexity and project requirements.
4. What is testing and debugging?
Ans:- Testing and debugging are essential steps in software development to ensure error-free programs.
Testing:
- The process of executing a program with different test cases to check correctness.
- Identifies bugs and performance issues.
- Types include unit testing, integration testing, and system testing.
Debugging:
- The process of finding and fixing errors or bugs in the program.
- Involves analyzing code, identifying errors, and modifying the program to remove issues.
- Uses debugging tools and techniques like breakpoints, print statements, and IDE debuggers.
Both processes help in delivering reliable and efficient software.
5. What is a decision table?
Ans:- A decision table is a structured way of representing logical conditions and their corresponding actions in a tabular form. It is used for decision-making processes in programming and business rules.
Components of a decision table:
- Condition Stubs: List of all possible conditions.
- Action Stubs: Possible actions that can be taken.
- Condition Entries: Different conditions (Yes/No or True/False).
- Action Entries: The result or action for each condition combination.
Example:
Condition | A > 10 | B < 5 | Action |
---|---|---|---|
Case 1 | Yes | Yes | Print "Valid" |
Case 2 | Yes | No | Print "Invalid" |
Case 3 | No | Any | Print "Error" |
Decision tables simplify complex logic and help in structured programming.
6. What do you mean by a programming language? Explain two types.
Ans:- A programming language is a formal set of instructions used to communicate with computers to perform specific tasks. It consists of syntax and rules to write programs efficiently.
Types of programming languages:
Low-Level Language:
- Machine-level (binary code) and Assembly-level (mnemonics).
- Directly interacts with hardware.
- Example: Assembly language.
High-Level Language:
- Uses human-friendly syntax.
- Requires a compiler or interpreter to convert into machine code.
- Example: Python, Java, C++.
Programming languages are essential for software development and automation.
SHORT ANSWER TYPE QUESTIONS
1. Write advantages of flowchart.
Ans:-
- Simplifies complex problems.
- Easy to understand and communicate logic.
- Helps in debugging and troubleshooting.
- Improves documentation and software planning.
2. What is documentation?
Ans:-
Documentation refers to written records explaining program functionality, code structure, and instructions for users and developers. It includes user manuals, comments in code, and design specifications.
3. Write advantages & disadvantages of pseudo code.
Ans:-
Advantages:
- Improves readability and understanding.
- Easy to convert into programming languages.
Disadvantages:
- No strict syntax rules.
- Cannot be executed directly by a computer.
4. What is a translator?
Ans:- A translator is a software program that converts high-level or assembly language code into machine code. Examples include compilers, interpreters, and assemblers.
5. Write any two differences between a compiler and an interpreter.
Ans:-
- Compiler translates the entire program at once, while an interpreter translates line by line.
- Compiled programs run faster, whereas interpreted programs execute slower due to real-time translation.
MULTIPLE CHOICE QUESTIONS
Decision symbol is used:
Ans:- (a) to write the conditionThe shape of Terminal box is:
Ans:- (b) ovalConnectors are used in a flowchart to:
Ans:- (b) continueProcess symbol is used to:
Ans:- (b) process the data/instructionWhat will be the output of the pseudo code?
Ans:- (c) bThe process of repetition is called:
Ans:- (c) loopingFlowchart & Algorithm are used for:
Ans:- (d) all of theseWhich memory translates one line at a time?
Ans:- (a) Interpreter
No comments:
Post a Comment