Humanities/Arts Exam  >  Humanities/Arts Notes  >  Computer Science for Class 11  >  NCERT Solutions: Introduction to Problem Solving

Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts PDF Download

Q1: Write pseudocode that reads two numbers and divide one by another and display the quotient.
Ans:

Input number_1

Input number_2

IF number_2 == 0 Then

      Print "Division by ZERO is not allowed"

ELSE

     quotient = number_1 / number_2

     Print quotient

END IF

Q2: Two friends decide who gets the last slice of a cake by flipping a coin five times. The first person to win three flips wins the cake. An input of 1 means player 1 wins a flip, and a 2 means player 2 wins a flip. Design an algorithm to determine who takes the cake?
Ans:
SET p1 = 0

SET p2 = 0

For i in range(5):

     INPUT coin_number

        IF coin_number is 1 THEN

            p1 = p1 + 1

        ELSE IF coin_number is 2 THEN

            p2 = p2 + 1

 IF p1 > 2 THEN

     PRINT "Player 1 wins"

     Break

ELIF p2 > 2 THEN 

     PRINT "Player 2 wins"

     Break

Q3: Write the pseudocode to print all multiples of 5 between 10 and 25 (including both 10 and 25).
Ans:

FOR number = 10 to 25

        IF number MOD 5 == 0 THEN

            Print number

        END IF

Q4: Give an example of a loop that is to be executed a certain number of times.
Ans:

FOR number = 11 to 25

        Print number

Q5: Suppose you are collecting money for something. You need ₹ 200 in all. You ask your parents, uncles and aunts as well as grandparents. Different people may give either ₹ 10, ₹ 20 or even ₹ 50. You will collect till the total becomes 200. Write the algorithm.
Ans:

SET CollectMoney = 0

WHILE CollectMoney < 200 DO

     INPUT money

     CollectMoney = CollectMoney + money

END LOOP

Q6: Write the pseudocode to print the bill depending upon the price and quantity of an item. Also print Bill GST, which is the bill after adding 5% of tax in the total bill.
Ans:

Input price_per_unit

Input quantity

Bill_without_GST = price_per_unit * quantity

Print Bill_without_GST

gst = Bill_without_GST * 5/100

Bill_with_GST = Bill_without_GST + gst

Print Bill_with_GST

Q7: Write pseudocode that will perform the following:
(a) Read the marks of three subjects: Computer Science, Mathematics, and Physics, out of 100
(b) Calculate the aggregate marks
(c) Calculate the percentage of marks

Ans:

Input CS_Marks
Input Math_Marks
Input Physics_Marks
Aggr_Marks = CS_Marks + Math_Marks + Physics_Marks
Print Aggr_Marks
percentage = Aggr_Marks/300 * 100
Print percentage

Q8: Write an algorithm to find the greatest among two different numbers entered by the user.
Ans:

Input num_1
Input num_2
IF num_1 > num_2 THEN
     Print num_1
ELSE IF num_1 < num_2 THEN
     Print num_2

Q9: Write an algorithm that performs the following: 
Ask a user to enter a number. If the number is between 5 and 15, write the word GREEN. If the number is between 15 and 25, write the word BLUE. if the number is between 25 and 35, write the word ORANGE. If it is any other number, write that ALL COLOURS ARE BEAUTIFUL.
Ans:

Input num_1

IF num_1 >= 5 AND num_1 <= 15 THEN

     Print "GREEN"

ELSE IF num_1 > 15 AND num_1 <= 25 THEN

     Print "BLUE"

ELSE IF num_1 > 25 AND num_1 <= 35 THEN

     Print "ORANGE"

ELSE

     Print "ALL COLOURS ARE BEAUTIFUL"

Q10: Write an algorithm that accepts four numbers as input and find the largest and smallest of them.
Ans:

Input n1

Input n2

Input n3

Input n4

IF n1 > n2 AND n1 > n3 AND n1 > n4 THEN

     Print n1

ELSE IF n2 > n1 AND n2 > n3 AND n2 > n4 THEN

     Print n2

ELSE  IF n3 > n1 AND n3 > n2 AND n3 > n4 THEN

     Print n3

ELSE  IF n4 > n1 AND n4 > n2 AND n4 > n3 THEN

     Print n4

Q11: Write an algorithm to display the total water bill charges of the month depending upon the number of units consumed by the customer as per the following criteria: 

  • for the first 100 units @ 5 per unit 
  • for next 150 units @ 10 per unit 
  • more than 250 units @ 20 per unit 

Also add meter charges of 75 per month to calculate the total water bill .
Ans:

Input number_of_units

bill = 0

IF number_of_units <=100 THEN

     bill = number_of_units * 5

ELSE IF number_of_units > 100 AND number_of_units <=250 THEN

     bill = (number_of_units-100) * 10 + 500

ELSE IF number_of_units > 250 THEN

     bill = (number_of_units - 250) * 20 + 2000

bill = bill + 75

Print bill

Q12: What are conditionals? When they are required in a program?
Ans: Conditional statements in Python are required to execute the code based on the output of the condition. They help check possibilities in a program. The program evaluates one or more conditions and performs operations depending on whether the condition is true or false.

Q13: Match the pairs
Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/ArtsAns:
Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts


Q14: Following is an algorithm for going to school or college. Can you suggest improvements in this to include other options?Reach_School_Algorithm 
(a) Wake up 
(b) Get ready 
(c) Take lunch box 
(d) Take bus 
(e) Get off the bus 
(f) Reach school or college

Ans:
(a) Wake up
(b) Thank GOD for the beautiful morning
(c) Brush teeth
(d) Wear uniform
(e) Eat breakfast
(f) Take lunch box
(g) Take I-Card
(h) Say Bye to Parents
(i) Go to Bus Stop
(j) Take bus
(k) Get off the bus
(l) Reach school or college

Q15: Write a pseudocode to calculate the factorial of a number (Hint: Factorial of 5, written as 5! = 5 × 4 ×3 ×2×1) .
Ans:

Factorial=1

input Num1

IF(Num1==0) THEN

     Factorial=1

ELSE

     WHILE(Num1!=0) DO

          Factorial=Factorial*Num1

          Number=Number-1

     END WHILE

END IF

Print Factorial


Q16: Draw a flowchart to check whether a given number is an Armstrong number. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 3**3 + 7**3 + 1**3 = 371.
Ans:
Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts


Q17: Following is an algorithm to classify numbers as 
“Single Digit”, “Double Digit” or “Big”.
Classify_Numbers_Algo
Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts
Verify for (5, 9, 47, 99, 100 200) and correct the algorithm if required
Ans:
Verification for Input Numbers:
For 5:
Output: “Single Digit” #Correct Output
For 9:
Output: “Double Digit” #Wrong Output
For 47:
Output: “Double Digit” #Correct Output
For 99:
Output: “Big” #Wrong Output
For 100:
Output: “Big” #Correct Output
For 200:
Output: “Big” #Correct Output
Correct Algorithm is given below:

INPUT Number

IF Number ≤ 9

   "Single Digit"

Else IF Number ≤ 99

   "Double Digit"

Else

   "Big"

Q18: For some calculations, we want an algorithm that accepts only positive integers upto 100.
Accept_1to100_Algo
INPUT Number
IF (0<= Number) AND (Number <= 100)
ACCEPT
Else
REJECT
(a) On what values will this algorithm fail?
(b) Can you improve the algorithm?

Ans:
(a) Algorithm will fail for value 0(ZERO)
(b) Correct algorithm is

Accept_1to100_Algo

INPUT Number

IF (0< Number) AND (Number <= 100)

     ACCEPT

Else

     REJECT

The document Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts is a part of the Humanities/Arts Course Computer Science for Class 11.
All you need of Humanities/Arts at this link: Humanities/Arts
33 docs|11 tests

FAQs on Introduction to Problem Solving NCERT Solutions - Computer Science for Class 11 - Humanities/Arts

1. What is the importance of problem-solving skills in academics?
Ans. Problem-solving skills are crucial in academics because they help students navigate complex situations, think critically, and develop logical reasoning. These skills enable students to analyze problems, break them down into manageable parts, and devise effective solutions, which are essential for success in various subjects.
2. How can students improve their problem-solving abilities?
Ans. Students can improve their problem-solving abilities by practicing regularly, engaging in group discussions, participating in puzzles and games, and learning different problem-solving strategies such as trial and error, working backwards, or using algorithms. Seeking feedback from teachers and peers can also enhance their skills.
3. What are some common problem-solving strategies?
Ans. Common problem-solving strategies include defining the problem clearly, brainstorming possible solutions, evaluating alternatives, implementing the chosen solution, and reviewing the outcome. Techniques like mind mapping, flowcharts, and the scientific method can also aid in systematic problem-solving.
4. How does problem-solving relate to real-life situations?
Ans. Problem-solving is directly related to real-life situations since individuals encounter various challenges daily. Whether it’s making decisions, resolving conflicts, or planning projects, effective problem-solving skills allow individuals to approach issues logically and creatively, leading to better outcomes.
5. Can problem-solving skills be developed over time?
Ans. Yes, problem-solving skills can be developed over time through practice and experience. Engaging in activities that challenge one's thinking, learning from mistakes, and reflecting on past problem-solving experiences can significantly enhance these skills. Continuous learning and adaptation are key to improvement.
Related Searches

Extra Questions

,

Previous Year Questions with Solutions

,

Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts

,

mock tests for examination

,

shortcuts and tricks

,

Free

,

past year papers

,

Sample Paper

,

practice quizzes

,

Important questions

,

MCQs

,

ppt

,

Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts

,

Introduction to Problem Solving NCERT Solutions | Computer Science for Class 11 - Humanities/Arts

,

study material

,

pdf

,

Exam

,

Summary

,

video lectures

,

Viva Questions

,

Semester Notes

,

Objective type Questions

;