Page 254 - CA_Blue( J )_Class10
P. 254

Fill in the blanks of the given program with appropriate statements.
                     class (i) ____
                     {
                         void Display(int n) {
                            while((ii) ______)
                            {
                            int rem= (iii) ______
                            System.out. println( rem);
                            n={iv) ______
                        }_
                     }
                     void Display() {
                        for(v)______· x<= (vi)______; x+=0.5)
                        System.out.println(x);
                            }
                     }
                     (i)  a. Number          b. number              c. NUMBER              d. NUM
                     (ii)  a. n<0            b. n>0                 c. n=0                 d. n=0
                     (iii)  a. n%100;        b. n/10;               c. n%10; ·             d. n/100
                     (iv)  a. n%10;          b. n/10;               c. n/100;              d. n%100
                     (v)  a. double x=0.5    b. Double x=0.5        c. double x=0.0        d. Double x=0.0
                     (vi)  a. x>=5.0         b. x<=5.0              c. X 5.0               d. x=5.0
                Ans.  (i) a     (ii) b       (iii) c     (iv) b     (v) a      (vi) b
                  4.  A school is giving away merit certificates for the students who have scored 90 percentage and above in class 10.
                     The following program is based on 'the specification given below. Fill in the blanks with appropriate Java statements.  [2022]
                     class name     :  Student
                     Member variables:
                     String name    :  To enter name of a student
                     double per     :  To enter percentage obtained by the student
                     String cer     :  To store the message
                     Member method
                     void input()   :  To accept the detail
                     void merit()   :  To check the percentage and award the merit
                     void display()   :  To display the detail
                     void main ()   :  To create an object of the t;lass and invoke the methods
                     import java. (i) ______* .
                     class Student {
                       String name;
                       double per;
                       String cer;
                     void input() {
                     Scanner obj= new Scanner (System.in);
                     System.out.println(" Enter name , Percentage");
                     name= obj.next();
                     per= (ii) ____
                     void merit() {
                     if ((iii), ___)
                     {
                     cer="AWARDED";
                     else
                     cer=(iv) ___
                     void (v), ___
                     System.out. println(name );
                     System.out.println(per);
                     System.out.println( cer );

                252252  Touchpad Computer Applications-X
   249   250   251   252   253   254   255   256   257   258   259