- Book Solutions
- State Boards
NCERT Solutions Class 11 Computer Science Chapter 4 Introduction to Problem Solving
NCERT Solutions Class 11 Computer Science Chapter 4 Introduction to Problem Solving: National Council of Educational Research and Training Class 11 Computer Science Chapter 4 Solutions – Introduction to Problem Solving. NCERT Solutions Class 11 Computer Science Chapter 4 PDF Download.
NCERT Solutions Class 11 Computer Science Chapter 4: Overview
Question 3. Write the pseudocode to print all multiples of 5 between 10 and 25 (including both 10 and 25).
FOR EACH I := 10 TO 15
IF I % 5 :=0 THEN
Question 4. Give an example of a loop that is to be executed a certain number of times.
Answer: Suppose we certain number starting from 11 to 16. The loop will be executed as follow:
SET i: = 11
FOR i: = 11 to 16 do
Question 5. 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.
Step 1: Set need Money := 0
Step 2: While Loop (need Money <200)
Input money
Step 3: need Money : = need Money + money
Step 4: End Loop
Question 6. 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.
INPUT all_Item
INPUT price_for_each_Item
COMPUTE bill :=totalItem * price_for_each_Item
COMPUTE tax := bill * (5 / 100)
COMPUTE bill_with_gst := bill + tax
PRINT bill_with_gst
Question 7. 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.
INPUT Computer_Science, maths, physics
COMPUTE aggregate := (Computer_Science + maths + physics) / 3
COMPUTE percentage := ((Computer_Science + math + physics) / 300) * 100
PRINT aggregate
PRINT percentage
Question8. Write an algorithm to find the greatest among two different numbers entered by the user.
Step1: READ num1
Step2: READ num2
Step3:IF (num1 > num2)
Question9 . 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.
Step 1: INPUT n
Step 2: IF n>5 And n<15 THEN
Step 3: PRINT “GREEN”
Step 4: ELSE IF n>15 And n<225 THEN
Step 5: PRINT “BLUE”
Step 6 : ELSE IF n>25 And n<35 THEN
Step 7: PRINT “ORANGE”
Step 8: ELSE
PRINT “ALL COLOURS ARE BEAUTIFUL”
Step 9: End IF
Question 10. Write an algorithm that accepts four numbers as input and find the largest and smallest of them.
Question11. 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 .
Step 1: INPUT units
Setp 2: SET bill := 0
Step 3: IF units > 250 THEN
COMPUTE bill := units * 20
IF units <= 100 THEN
COMPUTE bill := units * 5
COMPUTE bill := 100 * 5 + (units – 100) * 10
Step 4: END IF
Step 5: COMPUTE total_Bill := bill + 75
Step 6: PRINT total_Bil
Question 12. What are conditionals? When they are required in a program?
In programming conditionals are used for providing the condition to values, input and output. There are various conditional statements are there to evaluate the expression. Generally conditional statement give us a output in the form of true or false which is known as Boolean value.
Conditionals are required in program to check whether the value is satisfied with required output or not.
In case you are missed :- Previous Chapter Solution
Question 13. Match the pairs
Question14. Following is an algorithm for going to school or college. Can you suggest improvements in this to include other options?
Reach_School_Algorithm
b) Get ready
c) Take lunch box
d) Take bus
e) Get off the bus
f) Reach school or college
- Brush our teeth
- Do some exercise
- Take a bath
- Take a breakfast
- Take a lunch box
- Go to bus stand
- Get off the bus
- Reach school or college
Question 15. Write a pseudocode to calculate the factorial of a number (Hint: Factorial of 5, written as 5!=5 4 3 21 ×××× )
INPUT number
SET factorial := 1, i := 1
WHILE i<= number DO
COMPUTE factorial := factorial * i
INCREASE i by 1
PRINT factorial
Question 16. 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.
Question 17. Following is an algorithm to classify numbers as “Single Digit”, “Double Digit” or “Big”. Classify_Numbers_Algo
INPUT Number
IF Number < 9
“Single Digit”
Else If Number < 99
“Double Digit”
Verify for (5, 9, 47, 99, 100 200) and correct the algorithm if required.
For given data,
5 and 9 are single digit number, so it will print “single digit”
47 and 99 are double digit number, so it will print “double digit”
100 and 200 is a three digit number, so it will print “big”
Correct algorithm:
Step 1: INPUT Number
Step 2: IF Number <= 9
Step 3: Else If Number <= 99
Step 4: Else
Step 5: End IF
Question 18. For some calculations, we want an algorithm that accepts only positive integers upto 100.Accept_1to100_Algo
IF (0<= Number) AND (Number <= 100)
a) On what values will this algorithm fail?
b) Can you improve the algorithm?
This algorithm fails at value 0. Because in condition we specify “greater than equal to operator”. So it will accept zero also.
IF (0<Number) AND (Number <= 100)
In case you are missed :- Next Chapter Solution
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.
We have a strong team of experienced Teachers who are here to solve all your exam preparation doubts
Ncert joyful mathematics class 1 worksheet 4 – making 10, pseb class 4 math solution chapter 10 patterns, pseb class 4 math solution chapter 6 time, new mathematics today class 5 solutions chapter 14 – volume.
Sign in to your account
Username or Email Address
Remember Me
IMAGES
VIDEO