Page 332 - ComputerScience_Class_11
P. 332

9               System.out.println("-------------------------------------------");
                10               System.out.println("Student Name\tStudent Marks");

                11               for(i=0; i<len; i++)
                12               {

                13                   System.out.println(stu_name[i]+ "\t\t" + stu_marks[i]);
                14                   total_marks = total_marks + stu_marks[i];

                15               }
                16               avg_marks=(double)total_marks/(double)len;
                17               System.out.println("Total marks is: "+ total_marks);

                18               System.out.println("Average Marks of the class is: "+ avg_marks);

                19           }
                20       }

              To take input from the user:



















              The output of the preceding program is as follows:
                       BlueJ: Terminal Window - Java

                   Options

                  Total number of students in the class: 5
                  ----------------------------------------------------
                  Student Name  Student Marks

                  Ramesh        90
                  Ram           95

                  Ayan          99
                  Ajoy          98
                  Baban         89

                  Total marks is:   471
                  Average Marks of the class is: 94.2







                  330  Touchpad Computer Science (Ver. 3.0)-XI
   327   328   329   330   331   332   333   334   335   336   337