Page 114 - CA_Blue( J )_Class10
P. 114

C.  Answer the following questions:
                  1.  What do you mean by Library methods?
                  2.  What are the two types of methods used in Java?
                  3.  Define the methods Math.max() and Math.pow().
                  4.  How many arguments are required for the Math.sqrt() method?
                                                        r   nt
                  5.  Write down the Java expression for A = P 1 +   n  .
                  6.  Write a Java program to:
                    a.   Input principal amount, rate of interest and time period in years. Calculate the maturity amount using the following formula:
                      A=p*(1+r/100)  n
                    b.  Find the Surface Area and Volume of a Cone using the following formulae:
                      Surface Area = (PI * radius * slant height) + (PI * radius )
                                                                                        2
                                             2
                      Volume = PI * radius  * height/3.
                    c.  Input three numbers a, b and c, and print the result of the following formula:
                                3
                         3
                              2
                       r =  a + b  -   c
                    d.  Input the diameter and calculate the area and circumference of a circle.
                      Area of circle: πr   2
                      Circumference of circle: 2πr
                    e.   Input starting population (p0), percentage rate of population (r), time in years (t) and Euler number (e = 2.71828) and
                       calculate the total population using the following formula:
                      p = p  x e  rt
                            0
              D.  Assertion and Reasoning based questions.
                      The following questions consist of two statements – Assertion (A) and Reason (R). Answer these questions by selecting the
                    appropriate option given below:
                    a.  Both A and R are true, and R is the correct explanation of A.
                    b.  Both A and R are true, but R is not the correct explanation of A.
                    c.  A is true, but R is false.
                    d.  A is false, but R is true.
                  1.  Assertion (A): The Math.pow() method is used to calculate the power of a number.
                     Reason(R): The Math.pow() method takes two arguments: the base and the exponent.
                  2.  Assertion (A): The Math.ceil() method returns the smallest integer greater than or equal to the argument.
                     Reason (R): The Math.ceil() method rounds down a floating-point number to the nearest integer.
                                                                                               21 st
              E.  Case-based questions.                                                      Century   #Experiential Learning
                                                                                               Skills
                  1.  Emelia is working on a statistical analysis tool. She needs to find the maximum and minimum values in a set of data points. Given
                    two numbers, num1 and num2, which Java methods should Emelia use to find the maximum and minimum values?
                    a.  Math.max(num1, num2) and Math.min(num1, num2)
                    b.  Math.highest(num1, num2) and Math.lowest(num1, num2)
                    c.  Math.greatest(num1, num2) and Math.least(num1, num2)
                    d.  Math.maxValue(num1, num2) and Math.minValue(num1, num2)
                  2.  Annant is developing a sales application that requires rounding up the total cost to the nearest whole number. Which of the
                    following methods from the Math class should Annant use to round up a floating-point number?
                    a.  Math.ceil()                                 b.  Math.floor()
                    c.  Math.round()                                d.  Math.truncate()

                                          Previous Years' Questions


                  1.  What value will Math.sqrt (Math.ceil (15.3)) return?                                        [2023]
                    a.  16.0                                        b.  16
                    c.  4.0                                         d.  5.0
                Ans.  c


                112112  Touchpad Computer Applications-X
   109   110   111   112   113   114   115   116   117   118   119