Page 67 - iPlus_Ver_2.0_class_8
P. 67

D.  Match the columns:

                     1. ==                               a. Assignment operator
                     2. =                                b. Unary operator

                     3. ||                               c. Equality operator

                     4. ++                               d. Logical OR operator

                                                        Section B (Subjective)
                 A.  Short answer type questions:
                     1.  What is Java?

                     2.  Explain the use of assignment operator.
                     3.  Define arithmetic operators.

                 B.  Long answer type questions:
                     1.  List any four features of Java.

                     2.  What are logical operators? Write the names of any two logical operators.
                     3.  What is the use of unary operators? How many unary operators are there in Java?

                 C.  What will be the output of these Java codes?

                     1.  public class rad{
                                                                                 Write output here:
                              public static void main(String[] args){
                                      double r, c;

                                      r=2.3;
                                      c = 2 * 3.14 * r;

                                      System.out.println(c);
                              }
                                                                                 Write output here:
                            }
                     2.  public class A{

                              public static void main(String[] args)
                              {

                                      double s, GST, inv;
                                      s = 200;

                                      GST = 5 * s/100;
                                      inv = s + GST;

                                      System.out.println("GST to be paid:" + GST);
                                      System.out.println("Total invoice value:" + inv);

                              }
                            }



                                                                                                                  65
                                                                                               Program Coding
   62   63   64   65   66   67   68   69   70   71   72