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. Program to show the use of Labeled Break Statement

  2. Program to show an example of Copying i.e. Clonning Objects

  3. Program to show an example of Calling a Base Class Method from a Derived Class

  4. Program to display reverse $ tree

  5. Program in CORBA which takes a long sentence from client (at least 7 words), passes to the server, server separates out each word and sends back

  6. Program which creates an Array of character. Make one function with one argument as a character and that function throw a user defined exception

  7. Create an interface coversions. Which have the following functions Inchestomillimeters(), hptowatts(),wattstohp(),poundstogram(),gramtopounds()

  8. Corba program to Write a Echo server and client with UDP server and client

  9. Program to show the use of some Character Methods

  10. Corba program of date operations

  11. Program to extract a portion of a character string and print the extracted string

  12. Corba program of reverse string

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

  14. Program of insertion sort

  15. corba program of client and a DNS server where given a URL the server sends back an IP address

  16. Program to show an example of creating a String object from a StringBuffer Object

  17. An applet program to find maximum of three numbers using textField

  18. Corba program of game

  19. Program to declare, initialize and print a 2D array of integers

  20. Program to show the use of the Continue Statement