Free Java Program
Write a program to display the result of student
import java.io.*;
class Student
{
String name,div,clas;
float marks[]=new float[5];
float tot,per;
int i;
Student()
{
name="";
for(i=0;i<5;i++) tot="0;" per="0;" div="" clas="" name="n;" clas="c;" i="0;i<5;i++)" i="0;i<5;i++)" per="tot/5;">=75)
{
div="First";
}
else
if(per >=60 && per <75) div="Second">=40 && per <60)
{
div="Third";
}
else
if(per <40)
{
div="Fail";
}
}
void showData()
{
System.out.println("\t\t\tStudent Result");
System.out.println();
System.out.println("Name\t\t"+ "Marks\t"+ "Class\t"+"Division");
System.out.println("----------------------------------------");
System.out.println(name+"\t "+tot+"\t"+clas+"\t"+div);
}
}
class StudentResult extends Student
{
public static void main(String args[]) throws IOException
{
Student s1=new Student();
String name=new String();
String clas=new String();
float m[]=new float[5];
int i;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Name");
name=br.readLine();
System.out.println("Enter Your Class");
clas=br.readLine();
System.out.println("Enter Marks in Five Subjetcs");
for(i=0;i<5;i++)
{
m[i]=Float.parseFloat(br.readLine());
}
s1.getData(name,m,clas);
s1.calcDivision();
s1.showData();
}
}
Write a program to display the result of student
import java.io.*;
class Student
{
String name,div,clas;
float marks[]=new float[5];
float tot,per;
int i;
Student()
{
name="";
for(i=0;i<5;i++) tot="0;" per="0;" div="" clas="" name="n;" clas="c;" i="0;i<5;i++)" i="0;i<5;i++)" per="tot/5;">=75)
{
div="First";
}
else
if(per >=60 && per <75) div="Second">=40 && per <60)
{
div="Third";
}
else
if(per <40)
{
div="Fail";
}
}
void showData()
{
System.out.println("\t\t\tStudent Result");
System.out.println();
System.out.println("Name\t\t"+ "Marks\t"+ "Class\t"+"Division");
System.out.println("----------------------------------------");
System.out.println(name+"\t "+tot+"\t"+clas+"\t"+div);
}
}
class StudentResult extends Student
{
public static void main(String args[]) throws IOException
{
Student s1=new Student();
String name=new String();
String clas=new String();
float m[]=new float[5];
int i;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Name");
name=br.readLine();
System.out.println("Enter Your Class");
clas=br.readLine();
System.out.println("Enter Marks in Five Subjetcs");
for(i=0;i<5;i++)
{
m[i]=Float.parseFloat(br.readLine());
}
s1.getData(name,m,clas);
s1.calcDivision();
s1.showData();
}
}