Page 124 - Computer Science V2.0 Class 11
P. 124

Write an algorithm and draw a flowchart for each of the following tasks:
                    a.  Find the index of the food item on which the maximum amount is spent as a percentage of the total expenditure on
                       food.
                    b.  Find the index of the food item on which an amount, second to the maximum, is spent as a percentage of the total
                       expenditure on food.
                    c.  Find the index of the food item on which the minimum amount is spent as a percentage of the total expenditure on
                       food.
                    d.  Find the index of the food item on which an amount, second to the minimum, is spent as a percentage of the total
                       expenditure on food.


                     Case-based Questions


                 1.  Satish runs a business of readymade garments. The following process is followed before any consignment moves out of the
                    factory premises:
                    •  An order (by filling a supply request form) is received from a retailer
                    •  If the retailer is registered with the company, the supply request is accepted and the retailer is asked to make the
                       required payment.. Otherwise, the retailer is asked to register by filling out the registration form.
                    •  The payment for the requested order is checked with the bank. If the payment is not made, the retailer is notified to
                       make the payment.
                    •  Once the payment is confirmed, the stocks are checked in the godown. If there are enough stocks, the requested order
                       is shipped, otherwise, the retailer is notified about the delay.
                    As an employee of the company, Satish has asked you to write an algorithm and draw a flowchart for the given process.
                    Complete the task assigned to you.
                 2.  Gurleen works in a hotel. Whenever a guest checks out from the hotel, the bill is prepared as per the following criteria:
                    •  Number of days of stay are calculated based on check-in and check-out dates.
                    •  The tariff for different types of rooms is as follows:
                       ○ Deluxe @ 9000/- per day
                       ○ Premium @ 12000/- per day
                       ○ Suite @ 20000/- per day
                    Based on the type of room and number of days of stay, the total tariff is calculated.
                    •  Then the restaurant services used were added according to the table given below:
                       ○ Breakfast @ 1000/- per person per day
                       ○ Lunch and Dinner @ 1400/- per person per day.
                    Based on the information given above, Gurleen has to write a pseudocode to calculate the total bill for a customer. Break
                    the task into two modules—one for the stay and the other for restaurant service. Thereafter, combine the two amounts to
                    get the final bill.

                                              NCERT Exercise Solutions


                 1.  Write pseudocode that reads two numbers, divides one by another, and displays the quotient.
               Ans.  input number1
                    input number2
                    quotient = number1//number2
                    print quotient
                 2.  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.





               110   Touchpad Computer Science (Ver. 2.0)-XI
   119   120   121   122   123   124   125   126   127   128   129