Java Blog

 
 
 
import java.io.*;

class Marks 
{
    public static void main(String args[]) 
    {
           int data[] = new int[10];
           int counter,index;
           String str;


         try{
        BufferedReader obj = new BufferedReader(new InputStreamReader

(System.in));
                 for(counter=0;counter<10;counter++)
                   {
                         System.out.print(\"Enter Marks of Roll No :- 

\"+(counter+1)+\"   --> \");
                         System.out.flush();
                         str=obj.readLine();
                         data[counter]=Integer.parseInt(str);
                    }

            //logic begins       
                    for(counter=0;counter<10;counter++)
                        {
                           System.out.println(\"\\nMarks of 

Rollno : \"+(counter+1)+\" is  :     \"+data[counter]);
                            index=(int)(data[counter]/10);
                           switch(index)
                           {
                                case 10:
                                case 9:
                                case 8: 


System.out.println(\"Roll No : -  \"+(counter+1)+\"----->GRADE  A\");
                                        break;
                                case 7:
                                case 6:


System.out.println(\"Roll No : -  \"+(counter+1)+\"----->GRADE  B\");
                                        break;
                                case 5:
                                case 4:


System.out.println(\"Roll No : -  \"+(counter+1)+\"----->GRADE  C\");
                                        break;
                                case 3:
                                case 2:
                                case 1:
                                case 0:


System.out.println(\"Roll No : -  \"+(counter+1)+\"----->FAIL\");
                                }
                      }
                    }
                catch (Exception e)  {}
    }
}

    Related Post:
  1. An applet program of showing new document using showDocument(URL) method

  2. Develop a simple calculator with addition, subtraction, multiplication and division capabilities, data collection from client side, executed on server

  3. An applet program to display alternate filled and empty circle that to in row and column format

  4. Program to show an example of getting at characters in a String

  5. Write a class whose objects holds a current value and have a method to add that value, printing the new value

  6. Corba program to develop a simple calculator with addition, subtraction, multiplication and division capabilities, data collection from client side

  7. Write a program for restaurant

  8. Program to show an example of creating String objects from Character Arrays

  9. Program to show an example of creating a class and using its object

  10. Program to declare and initialize Boolean variables and print them on the Standard Output Device

  11. Program to show an example of extracting subStrings from a String

  12. Corba program of reverse string

  13. Game application in CORBA for which player will guess a number between 1 to 100, which will be compared to the random number generated by the class

  14. An applet program to draw concentric circle in center of the canvas

  15. Program to display attributes of a specified file

  16. Program that enabled applet calculator

  17. Corba program of UDP client server application which sends the news to the client. Server takes the news from the NewsDataFile located at the server

  18. Program using Switch case to compute the net amount to be paid by a customer

  19. An applet program to perform merge sort

  20. Program of UDP datagram