0% found this document useful (0 votes)
5 views3 pages

Java Student Grade Calculator Code

Uploaded by

nickysheby
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Java Student Grade Calculator Code

Uploaded by

nickysheby
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Student.

java

package pack1;

public class Student

double m1,m2,m3,cgpa;

String nme;

int rno;

public void assigndetails(String name,int rolno,double f1,double f2,double f3)

nme=name;

rno=rolno;

m1=f1;

m2=f2;

m3=f3;

public void dispdetails()

[Link]("name:"+nme);

[Link]("rolno:"+rno);

[Link]("mark1:"+m1);

[Link]("mark2:"+m2);

[Link]("mark3:"+m3);

public void grade()

cgpa=(m1+m2+m3)/30;

[Link](" CGPA:"+ cgpa);

if((cgpa>=9.0)&&(cgpa<=10))

[Link]("A grade");

if((cgpa>=8.0)&&(cgpa<=8.999))
[Link]("B grade");

if((cgpa>=7.0)&&(cgpa<=7.999))

[Link]("C grade");

if((cgpa>=6.0)&&(cgpa<=6.999))

[Link]("D grade");

if((cgpa>=5.0)&&(cgpa<=5.999))

[Link]("E grade");

if((cgpa>=0.1)&&(cgpa<=4.999))

[Link]("F grade - FAIL ");

[Link]

import [Link].*;

import [Link];

public class Sample

public static void main(String args[]) throws IOException

Student obj = new Student();

double f1,f2,f3;

String name;

int rolno;

BufferedReader in=new BufferedReader(new InputStreamReader([Link]));

[Link]("enter the name ");

name=[Link]();

[Link]("enter the rolno ");

rolno=[Link]([Link]());

[Link]("enter the mark 1 ");


f1=[Link]([Link]());

[Link]("enter the mark 2 ");

f2=[Link]([Link]());

[Link]("enter the mark 3 ");

f3=[Link]([Link]());

[Link](name,rolno,f1,f2,f3);

[Link]();

[Link]();

You might also like