daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Apr 21st, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. public class week4
  3. {
  4.     public static void main(String[] args) {
  5.  
  6. int n =1;
  7.  
  8. {
  9.     do{
  10.     n++;
  11.     String studentname;
  12.  
  13.     int mark;
  14.  
  15.     Scanner inText = new Scanner(System.in);
  16.  
  17.     System.out.print("Please enter the name of the student >> ");
  18.  
  19.     studentname = inText.nextLine();
  20.  
  21.     Scanner inNumber = new Scanner(System.in);
  22.  
  23.     System.out.print("Please enter mark for student " + studentname + " out of 100 >> ");
  24.  
  25.  
  26.     mark = inText.nextInt();
  27.  
  28.     if(mark <50) System.out.println("The grade for " + studentname + " is F " );
  29.  
  30.     else if(mark <65) System.out.println("The grade for " + studentname + " is P " );
  31.  
  32.     else if(mark <75) System.out.println("The grade for " + studentname + " is C " );
  33.  
  34.     else if(mark <85) System.out.println("The grade for " + studentname + " is D " );
  35.  
  36.     else System.out.println("The grade for " + studentname + " is HD" );
  37.  
  38.     } while(n <=3);
  39.  
  40.     Scanner input = new Scanner(System.in);
  41.  
  42.                 int sum = 0;
  43.                 int mark;
  44.                 int average;
  45.                 int counter = 1;
  46.  
  47.                 while (counter < 2){
  48.                     mark = input.nextInt();
  49.                     sum = sum + mark;
  50.                     counter++;
  51.                     average = sum/3;
  52.                     System.out.printf("The aerage score is " + average  );
  53.                 }
  54.  
  55.  
  56.         }
  57.     }
  58. }
RAW Paste Data
Top