/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package grade_book;
    import java.util.Scanner;
    class grade_book
    {
    private String course_name;
    private String rollno;
    private int age;
    private int[] grades={0,0,0,0};
    public grade_book()
    { }
    public grade_book(String c,String r,int a,int[]grades)
    {
    course_name=c;
    rollno=r;
    age=a;
    this.grades=grades;
    }
    public void set_course_name(String c)
    {
    course_name=c;
    }
    public void set_rollno(String r)
    {
    rollno=r;
    }
    public void set_age(int a)
    {
    age=a;
    }
    public void set_grades(int[] grades )
    { }
    public String get_course_name()
    {
    return course_name;
    }
    public String get_rollno()
    {
    return rollno;
    }
    public double get_age()
    {
    return age;
    }
    public int[] get_grades()
    {
    return grades;
    }
    void display_course_name()
    {
    System.out.println(course_name);
    }
    void display_rollno()
    {
    System.out.println(rollno);
    }
    void display_g()
    {
    for(int i=0;i<grades.length;i++)
    System.out.println(i);
    }
    public void show_grade_book()
    {
    System.out.println(course_name);
    System.out.println(rollno);
    System.out.println(age);
    for(int i=0;i<grades.length;i++)
    {
    System.out.println(grades[i]);
    }
    }
    public void set_grade_book()
    {
    Scanner s=new Scanner(System.in);
    System.out.println(“PLEASE ENTER COURSE NAME=”);
    course_name=s.nextLine();
    System.out.println(“PLEASE ENTER ROLLNO=”);
    rollno=s.nextLine();
    System.out.println(“PLEASE ENTER COURSE AGE=”);
    age=s.nextInt();
    for(int i=0;i<grades.length;i++)
    {
    System.out.println(“PLEASE ENTER COURSE grades=”);
    grades[i]=s.nextInt();
    }
    grade_book obj=new grade_book();
    }
    }
    public class java { /**
    • @param args the command line arguments
      */
      public static void main(String[] args) {
      grade_book obj=new grade_book();
      obj.set_grade_book();
      obj.show_grade_book();
      }
      // TODO code application logic here
      }

LEAVE A REPLY

Please enter your comment!
Please enter your name here