Page 193 - CA_Blue( J )_Class9
P. 193

C.  Assertion and Reasoning based question.
                     Assertion(A): Conditional flow of control is a programming concept where the flow of a program is altered based on a
                     specified condition, allowing the execution of specific statements according to the programmer's needs.
                     Reason(R): The essence of conditional flow is that the program control follows different paths based on whether a given
                     condition is true or false.
                     (a)   Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
                     (b)  Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
                     (c)   Assertion (A) is true and Reason (R) is false.
                     (d)  Assertion (A) is false and Reason (R) is true.
                                                                                     21 st
                 D.  More unsolved programs                                       Century   #Problem Solving & Logical Reasoning
                                                                                    Skills  #Interdisciplinary
                    1.   Programs using Conditional Flow of Control.
                        a.   A pen manufacturing international company declares that if the price of a pen is less than Rupees 500, then there
                          will be a gift else there will be a discount of 25% on the price. Write a program to input the price and print the
                          details according to the price.
                        b.   Write a program that to enter a positive number and displays whether entered number is an odd number or even
                          number.
                        c.    Write a program that to accept three integer numbers resembling the angles of a triangle. If the sum of all the
                          three angles is equal to 180 degree, then print it is a triangle else provide a suitable message.
                        d.  Write a Java program to accept a number between 1 and 7 from the user and displays the name of the weekday.
                        e.   Write a program to accept two numbers and print the square of the greater number and cube of the smaller
                          number. If the numbers are equal then, print twice of both the numbers.
                        f.    Write a program to input the customer’s name and the amount of purchase. Calculate the discount and the
                          discounted price on the criteria given below.
                                      Amount of purchase                       Discount%
                                          upto 3000                              5%
                                          upto 5000                              7%
                                          >=5000                                 10%
                        g.  Write a program to input the amount in bill and mode of payment and print the different facilities given by each
                           mode along with calculated amount to be paid.
                                       Mode of payment                         Facilities
                                       Credit Card(cc)                       1.5% discount
                                       Debit Card(dc)                        Rs. 10 cash back
                                       E Wallet(ew)                          Rs. 20 cash back
                                       Cash(c)                               No discount
                        h.  Write a program to calculate the monthly telephone bills as per the following rule:
                           Minimum Rs. 100 for up to 50 calls.
                           Plus Rs. 0.80 per call for next 50 calls.
                           Plus Rs. 0.60 per call for next 100 calls.
                           Plus Rs. 0.40 per call for any call beyond 200 calls.
                         i.  The shop has announced the following scheme for its sales personals according to the following criteria.
                                   Number of sales               Commission                      Gift
                               Upto 50 products             5% on selling amount             A Parker pen
                               51 to 75 products            7.5% on selling amount           A Micro SD card
                               76 to 100 products           10% on selling amount            A Mobile
                               More than 100 products       15% on selling amount            A Laptop






                                                                                     Conditional Constructs in Java  191
   188   189   190   191   192   193   194   195   196   197   198