Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

important questions ai (9)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Chapter 1: Algorithms and Flowcharts

2-3 Mark Questions:

1. Define an algorithm and mention its characteristics.

2. Explain the importance of flowcharts in programming.

3. List the basic symbols used in flowcharts and their significance.

4. Write an algorithm to find the largest of three numbers.

5. Draw a flowchart to calculate the factorial of a number.

6. Differentiate between algorithms and flowcharts.

7. Write a simple algorithm for checking if a number is even or odd.


MCQs:

1. Which of the following is NOT a characteristic of an algorithm?

a) Finite steps

b) Ambiguity

c) Input

d) Output

Answer: b) Ambiguity

2. What does the rectangle symbol represent in a flowchart?

a) Decision

b) Input/Output

c) Process

d) Start/End

Answer: c) Process

3. In an algorithm, the sequence of steps must be:

a) Unclear

b) Random

c) Well-defined

d) Infinite

Answer: c) Well-defined
4. Which flowchart symbol represents a decision-making process?

a) Oval

b) Diamond

c) Rectangle

d) Arrow

Answer: b) Diamond

Chapter 2: Introduction to Python

2-3 Mark Questions:

1. What is Python, and why is it popular in AI development?

2. Mention three applications of Python in real life.

3. Explain the difference between interactive mode and script mode in


Python.
4. List any four Python keywords.

5. Define variables in Python. How are they different from identifiers?

6. What is type conversion? Differentiate between implicit and explicit


type conversion.

7. Write a short note on Python IDLE and its uses.

8. Explain the purpose of the print() function with an example.

MCQs:

1. Python is classified as:

a) Compiled language

b) Interpreted language

c) Low-level language

d) Machine language

Answer: b) Interpreted language


2. Which of the following is a valid identifier in Python?

a) 9variable

b) _variable

c) variable@name

d) class

Answer: b) _variable

3. What is the result of the following Python statement?

Print(5 ** 2)

a) 10

b) 25

c) 7

d) 32

Answer: b) 25

4. Which function is used to take input from the user in Python?

a) input()

b) scanf()

c) get()

d) read()

Answer: a) input()
5. What does the following Python statement do?

X, y = 5, 10

Print(x + y)

a) Throws an error

b) Prints 15

c) Prints 510

d) Assigns 15 to x

Answer: b) Prints 15

6. Logical operators in Python include:

a) and, or, not

b) +, -, *

c) >, <, ==

d) =, +=, -=

Answer: a) and, or, not

7. What is the correct way to start a comment in Python?

a) //

b) /* */

c) #

d) –

Answer: c) #
8. Which operator is used to compare two values in Python?

a) =

b) ==

c) :=

d) >

Answer: b

1. Define an algorithm and mention its characteristics.

Answer: An algorithm is a step-by-step procedure to solve a specific problem.


Characteristics include:

Finiteness: It must terminate after a finite number of steps.

Definiteness: Each step must be clearly defined.

Input and Output: Must have specified inputs and outputs.

Effectiveness: Each step must be simple and executable.

2. Explain the importance of flowcharts in programming.


Answer: Flowcharts provide a visual representation of the logical steps in a
program, making it easier to understand, debug, and communicate the
algorithm to others.

3. List the basic symbols used in flowcharts and their significance.

Answer:

Oval: Start/End

Rectangle: Process

Diamond: Decision

Parallelogram: Input/Output

4. Write an algorithm to find the largest of three numbers.

Answer:

Step 1: Start

Step 2: Input three numbers: a, b, c

Step 3: If a > b and a > c, print “a is largest”

Step 4: Else if b > c, print “b is largest”

Step 5: Else, print “c is largest”

Step 6: Stop
5. Draw a flowchart to calculate the factorial of a number.

Answer: A flowchart showing a loop to multiply numbers from 1 to the input


value. (Not drawable here but essential to practice for exams.)

6. Differentiate between algorithms and flowcharts.

Answer:

Algorithm: Step-by-step textual representation.

Flowchart: Graphical representation of the algorithm.

You might also like