English

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. - Computer Science (Python)

Advertisements
Advertisements

Question

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.

Answer in Brief

Solution

Set sum = 0
While sum = 200
       Input money obtained
       Sum += money

Print thank you

Algorithm:

1 - Start
2 - Approach to parents, uncle, aunts, and grandparents
3 - Request for money
4 - Collect the given amount
5 - Add the amount received to make sure it is 200
6 - If not reach 200
7 - Again, request from others
8 - If received 200 goals achieved
9 - Stop

shaalaa.com
Algorithms
  Is there an error in this question or solution?
Chapter 4: Introduction to Problem Solving - Exercise [Page 83]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 4 Introduction to Problem Solving
Exercise | Q 5. | Page 83
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×