herrDeng網內搜尋

自訂搜尋

Ads

2011年5月26日 星期四

class example 1

33 則留言:

B9933068 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int economies;
float average(){
return ((float)english+math+computer+chinese+economies)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int econoies)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.economies=economies;
}
void printlnData()
{
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(economies);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(1,"吳邦俞",60, 66,70,90,90);
X.printlnData();
}
}

B9933061 提到...

class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int PE;
private int chinese;
float average(){
return ((float)english+math+computer+PE+chinese)/5;
}
Student(int id, String name, int english, int math, int computer,int PE,int chinese)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.PE=PE;
this.chinese=chinese;
}
public void printData(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(computer);
System.out.println(PE);
System.out.println(chinese);
System.out.println(average());
}

}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(61,"盧柏瑋",80, 66,70,80,75);
X.printData();
}
}

B9933068 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int economies;
float average(){
return ((float)english+math+computer+chinese+economies)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int economies)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.economies=economies;
}
void printlnData()
{
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(economies);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(1,"吳邦俞",60, 66,70,90,80);
X.printlnData();
}
}

B9933066 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int sport;
int chinese;
float average(){
return ((float)english+math+computer+sport+chinese)/5;
}
Student(int id, String name, int english, int math, int computer, int sport, int chinese)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.sport=sport;
this.chinese=chinese;
}
void Student1(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(sport);
System.out.println(chinese);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(66,"丘康利",90, 72,75,84,80);
X.Student1();

}
}

B9933106 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int PE;
float average(){
return ((float)english+math+computer)/3;
}
Student(int id, String name, int english, int math, int computer,int chinese,int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
public void student1(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(106,"劉仲惟",93,100,100,96,100);
X.student1();
}
}

B9933085 提到...

class Student{
private int id;
String name;
private int english;
private int math;
private int computer;
private int chinese;
private int PE;
float average(){
return ((float)english+math+computer+chinese+PE)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
public void Student1(){

System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());

}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(85,"羅智謙",60, 66,70,80,76);
X.Student1();
}
}

b9933110 提到...

class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int accounting;
private int chinese;
float average(){
return ((float)english+math+computer+chinese+accounting)/5;
}
Student(int id, String name, int english, int math, int computer,
int chinese,int accounting )
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.accounting=accounting;
}
public void printDate()
{

System.out.println("id:"+id);
System.out.println("名字:"+name);
System.out.println("英文:"+english);
System.out.println("數學:"+math);
System.out.println("程式設計:"+computer);
System.out.println("國文:"+chinese);
System.out.println("會計:"+accounting);


}



}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(1,"曾亭群",60, 66,70,76,80);
System.out.println("平均:"+X.average());
X.printDate();





}
}

B9933065 提到...

class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int economics;
private int pe;
float average(){
return ((float)english+math+computer+economics+pe)/5;
}
Student(int id, String name, int english, int math, int computer,int economics,int pe)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.economics=economics;
this.pe=pe;
}
public void show(){
System.out.println("id="+id);
System.out.println("name="+name);
System.out.println("english"+english);
System.out.println("math="+math);
System.out.println("computer="+computer);
System.out.println("economics="+economics);
System.out.println("pe="+pe);
System.out.println("average="+average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(1,"鍾光閔",60,70,80,90,75);
X.show();

}
}

b9933103 提到...

class Student{
private int id;
String name;
private int english;
private int math;
private int computer;
private int chinese;
private int PE;
float average(){
return ((float)english+math+computer+chinese+PE)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
public void Student1(){

System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());

}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(103,"吳秉儒",65, 66,77,88,99);
X.Student1();
}
}

B9933108 提到...

class Student{
private int id;
private String name;
private int chinese;
private int english;
private int math;
private int computer;
private int economics;
float average(){
return ((float)chinese+english+math+computer+economics)/5;
}
Student(int id, String name,int chinese, int english, int math, int computer,int economics)
{
this.id=id;
this.name=name;
this.chinese=chinese;
this.english=english;
this.math=math;
this.computer=computer;
this.economics=economics;
}
public void Show(){
System.out.println("id"+id);
System.out.println("name"+name);
System.out.println("chinese"+chinese);
System.out.println("english"+english);
System.out.println("math"+math);
System.out.println("computer"+computer);
System.out.println("economics"+economics);
System.out.println("average"+average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(1,"學生1",60, 66,70,70,85);
X.Show();

}
}

B9933098 提到...

class Student{
private int id;
String name;
private int english;
private int math;
private int computer;
private int chinese;
private int PE;
float average(){
return ((float)english+math+computer+chinese+PE)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
public void Student1(){

System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());

}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(98,"李瑞勳",65, 70,77,62,73);
X.Student1();
}
}

B9933100 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int PE;
int chinese;
float average(){
return ((float)english+math+computer+PE+chinese)/5;
}
Student(int id,String name,int english,int math,int computer,int PE,int chinese)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.PE=PE;
this.chinese=chinese;
}
void Student1(){
System.out.print("號碼=");
System.out.println(id);
System.out.print("姓名=");
System.out.println(name);
System.out.print("英文=");
System.out.println(english);
System.out.print("數學=");
System.out.println(math);
System.out.print("電腦=");
System.out.println(computer);
System.out.print("體育=");
System.out.println(PE);
System.out.print("國文=");
System.out.println(chinese);
System.out.print("平均=");
System.out.println(average());
}
}
public class java2{
public static void main(String[] args) {
Student X=new Student(100,"陳瑞聖",60,70,80,90,100);
X.Student1();
}
}

b9933075 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int PE;
float average(){
return ((float)english+math+computer)/3;
}
Student(int id, String name, int english, int math, int computer, int chinese, int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
void Student1(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(75,"陳柏修",70,50,80,75,70);
X.Student1();
}
}

b9933110 提到...

class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int accounting;
private int chinese;
float average(){
return ((float)english+math+computer+chinese+accounting)/5;
}
Student(int id, String name, int english, int math, int computer,
int chinese,int accounting )
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.accounting=accounting;
}
public void printDate()
{

System.out.println("id:"+id);
System.out.println("名字:"+name);
System.out.println("英文:"+english);
System.out.println("數學:"+math);
System.out.println("程式設計:"+computer);
System.out.println("國文:"+chinese);
System.out.println("會計:"+accounting);
System.out.println("平均:"+average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(9933110,"曾亭群",60, 66,70,76,80);

X.printDate();
}
}

b9933093 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int hi;
int wow;
float average(){
return ((float)english+math+computer+hi+wow)/5;
}
Student(int id, String name, int english, int math, int computer, int hi, int wow)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.hi=hi;
this.wow=wow;
}
public void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名:"+name);
System.out.println("英文="+english);
System.out.println("數學="+math);
System.out.println("電腦="+computer);
System.out.println("會計="+hi);
System.out.println("資訊管理="+wow);
System.out.println("平均="+average());
}
}
public class StudenData{
public static void main(String[] args) {
Student X=new Student(93,"周欣蓓",60,65,70,80,94);
X.printData();
}
}

B9933078 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名:"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class StudentData{
public static void main(String[] args){
Student X=new Student(78,"詹惠雯",60,52,66,72,70);
X.printData();
}
}

B9933097 提到...

class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int chinese;
private int accounting;
float average(){
return ((float)english+math+computer+chinese+accounting)/5;
}
Student(int id, String name, int english, int math
, int computer,int chinese,int accounting)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.accounting=accounting;
}
public void printData()
{
System.out.println("id:"+id);
System.out.println("name:"+name);
System.out.println("english:"+english);
System.out.println("math:"+math);
System.out.println("computer:"+computer);
System.out.println("chinese:"+chinese);
System.out.println("accounting:"+accounting);
System.out.println("average"+average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(9933097,"游博雅",60, 66,70,80,77);
X.printData();

}
}

b9933064 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class StudentData {
public static void main(String[] args){
Student X=new Student(64,"劉鈺淇",60,66,70,80,60);
X.printData();
}
}

a9933056 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class StudentData {
public static void main(String[] args){
Student X=new Student(56,"陳瑞祥",80,56,75,70,50);
X.printData();
}
}

A9933058 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class y1 {
public static void main(String[] args){
Student X=new Student(1,"劉方立",80,65,74,78,60);
X.printData();
}
}

A9933059 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class StudentData {
public static void main(String[] args){
Student X=new Student(1,"梁庭嘉",63,68,75,84,61);
X.printData();
}
}

b9833034 提到...

class f{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int economies;
float average(){
return ((float)english+math+computer+chinese+economies)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int economies)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.economies= economies;
}
void printlnData()
{
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(economies);
System.out.println(average());
}
}
public class f {
public static void main (String[] args) {
Student X=new Student(1,"雪君",60,66,70,60,60);
X.printlnData();
}
}

b9933089 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class StudentData {
public static void main(String[] args){
Student X=new Student(89,"劉鈺淇",70,66,69,87,55);
X.printData();
}
}

b9933115 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class StudentData {
public static void main(String[] args){
Student X=new Student(115,"賴若瑜",70,66,69,87,55);
X.printData();
}
}

b9933094 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chines1;
int chines2;
float average(){
return ((float)english+math+computer+chines1+chines2)/5;
}
Student(int id, String name, int english, int math, int computer, int chines1, int chines2)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chines1=chines1;
this.chines2=chines2;
}
public void printData()
{
System.out.println("ID"+id);
System.out.println("姓名"+name);
System.out.println("英文"+english);
System.out.println("數學"+math);
System.out.println("電腦"+computer);
System.out.println("國文1"+chines1);
System.out.println("國文2"+chines2);
System.out.println("平均"+average());
}
}
public class StudenData{
public static void main(String[] args) {
Student X=new Student(0,"李曼君",72,68,80,76,70);
X.printData();
}
}

b9933069 提到...

class Student{
private int id;
String name;
private int english;
private int math;
private int computer;
private int chinese;
private int PE;
float average(){
return ((float)english+math+computer+chinese+PE)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
public void Student1(){

System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());

}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(85,"李孝恩",60, 66,70,80,76);
X.Student1();
}
}

B9933072 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int PE;
float average(){
return ((float)english+math+computer)/3;
}
Student(int id, String name, int english, int math, int computer, int chinese, int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
void Student1(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(75,"林慶源",70,50,80,75,70);
X.Student1();
}
}

B9933072 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int PE;
float average(){
return ((float)english+math+computer)/3;
}
Student(int id, String name, int english, int math, int computer, int chinese, int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
void Student1(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(75,"林慶源",70,50,80,75,70);
X.Student1();
}
}

B9933072 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int PE;
float average(){
return ((float)english+math+computer)/3;
}
Student(int id, String name, int english, int math, int computer, int chinese, int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
void Student1(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(75,"林慶源",70,50,80,75,70);
X.Student1();
}
}

b9933114 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int PE;
float average(){
return ((float)english+math+computer+chinese+PE)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
public void student1(){
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(106,"邱櫪葶",60,70,65,80,60);
X.student1();
}
}

b9933087 提到...

class Student{
int id;
String name;
int english1;
int english2;
int math1;
int math2;
int computer;
float average(){
return((float)english1+english2+math1+math2+computer)/5;
}
Student(int id, String name, int english1, int english2, int math1, int math2, int computer)
{
this.id=id;
this.name=name;
this.english1=english1;
this.english2=english2;
this.math1=math1;
this.math2=math2;
this.computer=computer;
}
void printData()
{
System.out.println("ID:"+id);
System.out.println("姓名"+name);
System.out.println("英文1:"+english1);
System.out.println("英文2:"+english2);
System.out.println("數學1:"+math1);
System.out.println("數學2:"+math2);
System.out.println("電腦:"+computer);
System.out.println("平均:"+average());
}
}
public class StudentData {
public static void main(String[] args){
Student X=new Student(89,"楊文良",77,69,80,87,54);
X.printData();
}
}

B9933070 提到...

class Student{
int id;
String name;
int english;
int math;
int computer;
int chinese;
int economies;
float average(){
return ((float)english+math+computer+chinese+economies)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int econoies)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.economies=economies;
}
void printlnData()
{
System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(economies);
System.out.println(average());
}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(1,"李振綱",80, 44,70,50,90);
X.printlnData();
}
}

B9933116 提到...

class Student{
private int id;
String name;
private int english;
private int math;
private int computer;
private int chinese;
private int PE;
float average(){
return ((float)english+math+computer+chinese+PE)/5;
}
Student(int id, String name, int english, int math, int computer,int chinese,int PE)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.chinese=chinese;
this.PE=PE;
}
public void Student1(){

System.out.println(id);
System.out.println(name);
System.out.println(english);
System.out.println(math);
System.out.println(computer);
System.out.println(chinese);
System.out.println(PE);
System.out.println(average());

}
}
public class StudentData {
public static void main(String[] args) {
Student X=new Student(116,"洪智培",65, 66,77,88,99);
X.Student1();
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章