package javaapplication48;

import java.util.Scanner;
/**
*

  • @author kfueit
    */
    class GradeBook {

/**
*

  • @author Muhammad Imran
    */

/*

  • 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.
    */ /**
    • @param args the command line arguments
      */
      private String Coursename;
      private int rollno;
      private double age;
      private int[] grade;
      public GradeBook()
      {
      }
      public GradeBook(String c, int r, double a, int[]g)
      {
      Coursename=c;
      rollno=r;
      age=a;
      grade=g;
      }
    //public static void main(String[] args) {
    // TODO code application logic here
    //}
    public void Set_Coursename(String c)
    {
    Coursename=c;
    }
    public void Set_age(Double a)
    {
    age=a;
    }
    public void Set_grade(int[] g)
    {
    grade=g;
    }
    public void Set_rollno(int r)
    {
    rollno=r;
    }
    public String get_Coursename()
    {
    return Coursename;
    }
    public int get_rollno()
    {
    return rollno;
    }
    public double get_age()
    {
    return age;
    }
    public int[] get_grade()
    {
    return grade;
    }
    void Show_Coursename()
    {
    System.out.println(Coursename);
    }
    void Show_age()
    {
    System.out.println(age);
    }
    void Show_rollno()
    {
    System.out.println(rollno);
    }
    void Show_grade()
    { int i;
    for(i=0;i<grade.length;i++)
    System.out.println(grade[i]);
    }
    public void Show_GradeBook()
    {
    System.out.println(Coursename);
    System.out.println(age);
    System.out.println(rollno);
    int i;
    for(i=0;i<grade.length;i++)
    System.out.println(grade[i]); }
    public void get_GradeBook()
    {
    Scanner S=new Scanner(System.in);
    Coursename =S.next();
    rollno =S.nextInt();
    age =S.nextDouble();
    for(int i=0;i<grade.length;i++)
    grade[i]=S.nextInt(); }
    }

/////////////////////////////////////////////////////////////////////////
public class GradeBookTest

        {
/**
 * @param args the command line arguments
 */
public static void main(String[] args)


    {
        GradeBook g1=new GradeBook();
        g1.Set_Coursename("oop");
        g1.Set_rollno(31);
        g1.Set_age(18.5);
        int []g22={3,4,5,6};
        g1.Set_grade(g22);
        g1.Show_age();
        g1.Show_rollno();
        g1.Show_grade();
    }









    // TODO code application logic here
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here