Page 180 - CA_Blue( J )_Class9
P. 180

19             }
                    20             else if(p>=80 && c>=80 && b>=80)

                    21             {
                    22                 System.out.println("Stream – Bio Science");

                    23             }
                    24             else if(p>=50 && c>=50 && m>=70)
                    25             {

                    26                 System.out.println("Stream – Commerce with Maths");

                    27             }
                    28              else if(p>=50 && c>=50 && m>=50)
                    29             {

                    30                System.out.println("Stream – Commerce with BST");
                    31             }

                    32             else
                    33             {

                    34                 System.out.println("Stream – Nil");
                    35             }

                    36     }}

                  You will get the following output:


















                   Program 3      Input a number and print whether the number is a positive or negative even number, or a
                                  positive or negative odd number. (Use the ternary operator.)

                     1     import java.util.*;
                     2     class check_positive

                     3     {
                     4         public static void main()
                     5         {

                     6             Scanner sc= new Scanner(System.in);




                   178    Touchpad Computer Applications-IX
   175   176   177   178   179   180   181   182   183   184   185