SHARE
TWEET

Untitled

a guest Aug 12th, 2017 37 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2. import java.util.Scanner;
  3.  
  4. public class Grades
  5. {
  6.   public static void main(String[] args)
  7.   {
  8.     Scanner kbReader = new Scanner(System.in);
  9.     System.out.println("What's the name of your student?");
  10.     String s1 = kbReader.nextLine();
  11.    
  12.     Student student1 = new Student(s1);
  13.     System.out.println("How many grades do you want to enter for " + s1 + "?");
  14.     int ng = kbReader.nextInt();
  15.    
  16.     student1.inputGrades(ng);
  17.     System.out.println(student1.getName() + "'s average grade is " + student1.getAverage(ng));
  18.     System.out.println(student1.toString());
  19.   }
  20. }
RAW Paste Data
Top