title: enter name ,grade then print name and classified grade
body: <p>I was given the following problem:</p>
  
  <p>Write a Java program that prompts the user to enter names of 10 students
      and their grades as one string separated with ‘,’. For each student, print out
      his name and classified grade. 
      **Note: use for loop and switch. 
      **Hint: A (90-100) , B ( 80-89) , C (70-79) , D ( 60 – 69)</p>
  
  <pre><code>     Sample Run:
  
       Student1: Sara Alhazmi,88
       Output:
       Sara Alhazmi : B
  
       Student2: Nada Alamri,95
       Output:
      Nada Alamri : A
  
   (**Repeated 10 times)
  </code></pre>
  
  <p>Below is my solution:"after correcting my mistakes"
  thanks for helpe :)</p>
  
  <pre><code>  import java.util.*;
     public class students{
     public static void main(String args[])
    { Scanner input = new Scanner (System.in);
          int f = 10;
          for (int i = 1; i &lt;= f; i++)
      { System.out.println("Student" + i + ":");
       String s = input.nextLine();//s=name student and 
       String name = s.substring(0, s.indexOf(","));//name student 
       String sgrade = s.substring(s.indexOf(",")+1);//grad student
      double grade = Double.parseDouble(sgrade) / 10;// I can not use string with loop so I convert to double because I Divided 
        int ingrade = (int)Math.round(grade); // then I convert to integer 
         switch (ingrade) {
          case 10: 
           System.out.println(name + ": A");
          break;
           case 9:
          System.out.println(name + ": A");
              break;
           case 8: 
         System.out.println(name + ": B"); 
           break;
           case 7: 
       System.out.println(name + ": C");
          break;
           case 6:
         System.out.println(name + ": D");
            break; 
  
     }//end  while loop
    }//end for loop
   }// end main
   }// end class
  </code></pre>