herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
你會用C的算子sizeof?
-
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence C++ & Python都有字串的find,用法都類似 split=s.find(' ', split+1)能找到s從index=split+1開...
-
Python CPP heap priority queue速解L eetcode 2530. Maximal Score After Applying K Operations heap/priority queue是重要的資料結構,無論是C++的std::priority_q...
49 則留言:
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int PE;
private int chinese;
public 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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("PE\t"+PE);
System.out.println("chinese\t"+chinese);
System.out.println("average\t"+average());
}
}
public class java{
public static void main(String [] args){
Student []X=new Student[1];
X[0]=new Student(1,"好學生",60,86,71,55,47);
Student []Y=new Student[2];
Y[0]=new Student(2,"壞學生",50,76,72,54,87);
Student []Z=new Student[3];
Z[0]=new Student(3,"笨學生",77,66,55,55,47);
Student []A=new Student[4];
A[0]=new Student(4,"蠢學生",88,44,55,77,86);
Student []B=new Student[5];
B[0]=new Student(5,"傻學生",100,100,100,100,100);
X[0].printData();
System.out.println("-----------------");
Y[0].printData();
System.out.println("-----------------");
Z[0].printData();
System.out.println("-----------------");
A[0].printData();
System.out.println("-----------------");
B[0].printData();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int PE;
private int chinese;
public 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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("PE\t"+PE);
System.out.println("chinese\t"+chinese);
System.out.println("average\t"+average());
}
}
public class java{
public static void main(String [] args){
Student []X=new Student[1];
X[0]=new Student(1,"學生",60,66,70,70,80);
Student []Y=new Student[2];
Y[0]=new Student(2,"學生2",55,66,40,70,87);
Student []Z=new Student[3];
Z[0]=new Student(3,"學生3",100,66,70,100,80);
Student []A=new Student[4];
A[0]=new Student(4,"學生4",60,40,70,70,50);
Student []B=new Student[5];
B[0]=new Student(5,"學生5",60,0,70,70,20);
X[0].printData();
System.out.println("-----------------------");
Y[0].printData();
System.out.println("-----------------------");
Z[0].printData();
System.out.println("-----------------------");
A[0].printData();
System.out.println("-----------------------");
B[0].printData();
}
}
class Student{
private int id;
private String name;
private int chinese;
private int PE;
private int english;
private int math;
private int computer;
public float average(){
return((float)chinese+PE+english+math+computer)/5;
}
Student(int id,String name,int chinese,int PE,int english,int math,int computer)
{
this.id=id;
this.name=name;
this.chinese=chinese;
this.PE=PE;
this.english=english;
this.math=math;
this.computer=computer;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("chinese\t"+chinese);
System.out.println("PE\t"+PE);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("average\t"+average());
System.out.println("----------------------");
}
}
public class ggggg{
public static void main(String[]args){
Student []X=new Student[5];
X[0]=new Student(0,"學生0",61,66,71,66,71);X[0].printData();
X[1]=new Student(1,"學生1",62,67,72,67,72);X[1].printData();
X[2]=new Student(2,"學生2",63,68,73,68,73);X[2].printData();
X[3]=new Student(3,"學生3",64,69,74,69,74);X[3].printData();
X[4]=new Student(4,"學生4",65,70,75,70,75);X[4].printData();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int management;
private int economics;
public float average(){
return ((float)english+math+computer+management+economics)/5;
}
Student(int id, String name, int english, int math, int computer, int management,
int economics)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.management=management;
this.economics=economics;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("management\t"+management);
System.out.println("economics\t"+economics);
System.out.println("average\t"+average());
}
}
public class StudentDataArray {
public static void main(String[] args) {
Student []X=new Student[1];
X[0]=new Student(0,"Ken Lau",60, 66, 70, 18, 52);
X[0].printData();
}
}
class Student {
private int id;
private String name;
private int english;
private int math;
private int computer;
private int sport;
private int chinese;
public float average(){
return ((float)english+math+computer)/3;
}
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;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("sport\t"+sport);
System.out.println("chinese\t"+chinese);
System.out.println("average\t"+average());
}
}
public class StudentDataArray {
public static void main (String [] args){
Student []X=new Student[1];
X[0]=new Student (66,"丘康利",90,85,90,90,85);
Student []Y=new Student[2];
Y[0]=new Student (20,"Ray Allen",98,99,100,100,100);
Student []Z=new Student[3];
Z[0]=new Student (9,"Rajon Rondo",96,97,98,99,100);
Student []A=new Student[4];
A[0]=new Student (34,"Paul Pierce",97,98,99,100,100);
Student []B=new Student[5];
B[0]=new Student(5,"Kevin Garnett",98,99,99,100,100);
X[0].printData();
System.out.println("-----------------------");
Y[0].printData();
System.out.println("-----------------------");
Z[0].printData();
System.out.println("-----------------------");
A[0].printData();
System.out.println("-----------------------");
B[0].printData();
System.out.println("-----------------------");
}
}
class Student{
private int id;
private String name;
private int chinese;
private int english;
private int math;
private int computer;
private int PE;
public float average(){
return ((float)chinese+english+math+computer+PE)/5;
}
Student(int id, String name, int chinese, int english, int math, int computer,
int PE)
{
this.id=id;
this.name=name;
this.chinese=chinese;
this.english=english;
this.math=math;
this.computer=computer;
this.PE=PE;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("chinese\t"+chinese);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("PE\t"+PE);
System.out.println("average\t"+average());
}
}
public class StudentDataArray{
public static void main(String [] args){
Student []X=new Student[1];
X[0]=new Student(1,"學生1",96,93,100,100,90);
Student []Y=new Student[2];
Y[0]=new Student(2,"學生2",95,92,99,99,89);
Student []Z=new Student[3];
Z[0]=new Student(3,"學生3",94,91,98,98,88);
Student []A=new Student[4];
A[0]=new Student(4,"學生4",93,90,97,97,87);
Student []B=new Student[5];
B[0]=new Student(5,"學生5",92,89,96,96,86);
X[0].printData();
System.out.println("--------------------");
Y[0].printData();
System.out.println("--------------------");
Z[0].printData();
System.out.println("--------------------");
A[0].printData();
System.out.println("--------------------");
B[0].printData();
System.out.println("--------------------");
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int japanese;
private int economics;
public float average(){
return((float)english+math+computer+japanese+economics)/5;
}
Student (int id, String name, int english, int math, int computer, int japanese, int economics)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.japanese=japanese;
this.economics=economics;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("japanese\t"+japanese);
System.out.println("economics\t"+economics);
System.out.println("average\t"+average());
System.out.println();
}
}
public class zz{
public static void main(String[] args){
Student []X=new Student[5];
X[0]=new Student(0,"學生0",60,66,70,70,70); X[0].printData();
X[1]=new Student(0,"學生1",66,66,77,54,34); X[1].printData();
X[2]=new Student(0,"學生2",90,80,70,79,100); X[2].printData();
X[3]=new Student(0,"學生3",90,40,80,56,70); X[3].printData();
X[4]=new Student(0,"學生4",60,66,71,73,62); X[4].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="楊文良";
x[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="楊文良";
x[0].printDate();
}
}
class Student
{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int PE;
private int chinese;
public 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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("PE\t"+PE);
System.out.println("chinese\t"+chinese);
System.out.println("average\t"+average());
System.out.println("-------------------");
}
}
public class StudentDataArray
{
public static void main(String [] args)
{
Student []X=new Student[1];
X[0]=new Student(1,"學生1",60,66,70,60,60);
Student []Y=new Student[2];
Y[0]=new Student(2,"學生2",90,67,80,62,69);
Student []Z=new Student[3];
Z[0]=new Student(3,"學生3",85,65,77,63,64);
Student []A=new Student[4];
A[0]=new Student(4,"學生4",66,64,78,72,94);
Student []B=new Student[5];
B[0]=new Student(5,"學生5",68,62,80,90,56);
X[0].printData();
Y[0].printData();
Z[0].printData();
A[0].printData();
B[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int english1;
private int math;
private int math1;
private int computer;
public float average(){
return ((float)english+english1+math+math1+computer)/5;
}
Student(int id, String name, int english, int english1, int math, int math1, int computer)
{
this.id=id;
this.name=name;
this.english=english;
this.english1=english1;
this.math=math;
this.math1=math1;
this.computer=computer;
}
public void printData(){
System.out.println("id\t\t\t"+id);
System.out.println("name\t\t"+name);
System.out.println("english\t\t"+english);
System.out.println("english1\t"+english1);
System.out.println("math\t\t"+math);
System.out.println("math1\t\t"+math1);
System.out.println("computer\t"+computer);
System.out.println("average\t\t"+average());
}
}
public class StudentDataArray{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(0,"學生0",60,66,70,90,80);
X[0].name="劉鈺淇";
X[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="楊文良";
x[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",62,77,60,73,80);
x[0].name="林婉吟";
x[0].printDate();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int accounting;
private int chinese;
public float average(){
return((float)english+math+computer+chinese+accounting)/5;
}
Student(int id, String name, int english, int math, int computer, int accounting, int chinese)
{
this.id=id;
this.name=name;
this.chinese=chinese;
this.english=english;
this.math=math;
this.computer=computer;
this.accounting=accounting;
}
public void printData(){
System.out.println("id/t"+id);
System.out.println("name\t"+name);
System.out.println("chinese\t"+chinese);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("accounting\t"+accounting);
System.out.println("average\t"+average());
}
}
public class StudentDataArray {
public static void main(String[] args) {
Student []X=new Student[1];
X[0]=new Student(1,"學生1",65,70,80,78,60);
X[0].printData();
Student []z=new Student[2];
z[0]=new Student(2,"學生2",65,70,80,78,100);
z[0].printData();
Student []a=new Student[3];
a[0]=new Student(3,"學生3",65,70,80,78,90);
a[0].printData();
Student []n=new Student[4];
n[0]=new Student(4,"學生4",65,70,80,78,80);
n[0].printData();
Student []b=new Student[5];
b[0]=new Student(5,"學生5",100,100,100,100,100);
b[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",70,66,82,80,60);
x[0].name="康嘉紋";
x[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",70,66,80,81,61);
x[0].name="陳秀雯";
x[0].printDate();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int PE;
private int chinese;
public 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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("PE\t"+PE);
System.out.println("chinese\t"+chinese);
System.out.println("average\t"+average());
}
}
public class java{
public static void main(String [] args){
Student []X=new Student[1];
X[0]=new Student(1,"學生",60,75,60,75,50);
Student []Y=new Student[2];
Y[0]=new Student(2,"學生2",65,75,50,65,85);
Student []Z=new Student[3];
Z[0]=new Student(3,"學生3",70,60,80,90,70);
Student []A=new Student[4];
A[0]=new Student(4,"學生4",65,50,75,65,60);
Student []B=new Student[5];
B[0]=new Student(5,"學生5",70,65,80,30,80);
X[0].printData();
System.out.println("-----------------------");
Y[0].printData();
System.out.println("-----------------------");
Z[0].printData();
System.out.println("-----------------------");
A[0].printData();
System.out.println("-----------------------");
B[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",80,65,50,83,70);
x[0].name="賴若瑜";
x[0].printDate();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int chinese;
private int accounting;
public float average(){
return((float)english+math+computer)/3;
}
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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("accounting\t"+accounting);
System.out.println("average\t"+average());
System.out.println("===================");
}
}
public class StudentDataArray{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(1,"Student0",60,66,70,80,45);
X[0].printData();
Student []Y=new Student[2];
Y[0]=new Student(2,"Student1",67,46,90,30,77);
Y[0].printData();
Student []Z=new Student[3];
Z[0]=new Student(3,"Student2",70,69,78,77,55);
Z[0].printData();
Student []W=new Student[4];
W[0]=new Student(4,"Student3",81,75,72,55,68);
W[0].printData();
Student []V=new Student[5];
V[0]=new Student(5,"Student4",64,76,70,99,22);
V[0].printData();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int chinese;
private int accounting;
public float average(){
return((float)english+math+computer+chinese+accounting)/5;
}
Student(int id,String name,int english,int math,int computer,int accounting,int chinese)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.accounting=accounting;
this.chinese=chinese;
}
public void printData(){
System.out.println("id\t:"+id);
System.out.println("name\t:"+name);
System.out.println("english\t:"+english);
System.out.println("computer\t:"+computer);
System.out.println("math\t:"+math);
System.out.println("chinese\t:"+chinese);
System.out.println("accounting\t:"+accounting);
System.out.println("average\t:"+average());
System.out.println("=============================");
}
}
public class StudentDataArray{
public static void main (String[]args){
Student[]x=new Student[1];
x[0]=new Student(1,"學生1",60,66,70,80,88);
x[0].printData();
Student[]y=new Student[2];
y[0]=new Student(2,"學生2",70,80,70,80,100);
y[0].printData();
Student[]z=new Student[3];
z[0]=new Student(3,"學生3",60,100,92,99,100);
z[0].printData();
Student[]a=new Student[4];
a[0]=new Student(4,"學生4",100,100,99,100,100);
a[0].printData();
Student[]b=new Student[5];
b[0]=new Student(5,"學生5",98,99,97,96,100);
b[0].printData();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int chinese;
private int accounting;
public float average(){
return((float)english+math+computer+chinese+accounting)/5;
}
Student(int id,String name,int english,int math,int computer,int accounting,int chinese)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.accounting=accounting;
this.chinese=chinese;
}
public void printData(){
System.out.println("id\t:"+id);
System.out.println("name\t:"+name);
System.out.println("english\t:"+english);
System.out.println("computer\t:"+computer);
System.out.println("math\t:"+math);
System.out.println("chinese\t:"+chinese);
System.out.println("accounting\t:"+accounting);
System.out.println("average\t:"+average());
System.out.println("=============================");
}
}
public class StudentDataArray{
public static void main (String[]args){
Student[]x=new Student[1];
x[0]=new Student(1,"學生1",60,66,70,80,88);
x[0].printData();
Student[]y=new Student[2];
y[0]=new Student(2,"學生2",70,80,70,80,100);
y[0].printData();
Student[]z=new Student[3];
z[0]=new Student(3,"學生3",60,100,92,99,100);
z[0].printData();
Student[]a=new Student[4];
a[0]=new Student(4,"學生4",100,100,99,100,100);
a[0].printData();
Student[]b=new Student[5];
b[0]=new Student(5,"學生5",98,99,97,96,100);
b[0].printData();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int chinese;
private int accounting;
public float average(){
return((float)english+math+computer)/3;
}
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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("accounting\t"+accounting);
System.out.println("average\t"+average());
System.out.println("===================");
}
}
public class StudentDataArray{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(1,"Student0",60,66,70,80,45);
X[0].printData();
Student []Y=new Student[2];
Y[0]=new Student(2,"Student1",67,46,90,30,77);
Y[0].printData();
Student []Z=new Student[3];
Z[0]=new Student(3,"Student2",70,69,78,77,55);
Z[0].printData();
Student []W=new Student[4];
W[0]=new Student(4,"Student3",81,75,72,55,68);
W[0].printData();
Student []V=new Student[5];
V[0]=new Student(5,"Student4",64,76,70,99,22);
V[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
⋯⋯ private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",70,60,65,88,90);
x[0].name="徐志瑋";
x[0].printDate();
}
}更多
class Student {
private int id;
private String name;
private int english;
private int math;
private int computer;
private int chinese;
private int economies;
public 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;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("economies\t"+economies);
System.out.println("average\t"+average());
System.out.println("-----------------------");
}
}
public class StudentDataArray{
public static void main(String[] args) {
Student []X=new Student[1];
X[0]=new Student(1,"甲",60,48,76,90,72);
Student []Y=new Student[1];
Y[0]=new Student(2,"乙",77,86,80,92,84);
Student []Z=new Student[1];
Z[0]=new Student(3,"丙",58,98,60,77,96);
Student []C=new Student[1];
C[0]=new Student(4,"丁",82,62,70,67,73);
Student []T=new Student[1];
T[0]=new Student(5,"戊",56,73,78,80,83);
X[0].printData();
Y[0].printData();
Z[0].printData();
C[0].printData();
T[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int english1;
private int math;
private int math1;
private int computer;
public float average(){
return ((float)english+english1+math+math1+computer)/5;
}
Student(int id, String name, int english, int english1, int math, int math1, int computer)
{
this.id=id;
this.name=name;
this.english=english;
this.english1=english1;
this.math=math;
this.math1=math1;
this.computer=computer;
}
public void printData(){
System.out.println("id\t\t\t"+id);
System.out.println("name\t\t"+name);
System.out.println("english\t\t"+english);
System.out.println("english1\t"+english1);
System.out.println("math\t\t"+math);
System.out.println("math1\t\t"+math1);
System.out.println("computer\t"+computer);
System.out.println("average\t\t"+average());
System.out.println("==================");
}
}
public class StudentDataArray{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(0,"學生0",65,66,70,90,81);
X[0].name="劉鈺淇";
X[0].printData();
Student []z=new Student[2];
z[0]=new Student(1,"學生1",64,64,70,50,80);
z[0].name="劉鈺淇1";
z[0].printData();
Student []y=new Student[3];
y[0]=new Student(1,"學生2",60,64,70,90,88);
y[0].name="劉鈺淇2";
y[0].printData();
Student []a=new Student[4];
a[0]=new Student(1,"學生3",60,66,70,40,80);
a[0].name="劉鈺淇3";
a[0].printData();
Student []b=new Student[5];
b[0]=new Student(1,"學生4",60,65,78,94,85);
b[0].name="劉鈺淇4";
b[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int english1;
private int math;
private int math1;
private int computer;
public float average(){
return ((float)english+english1+math+math1+computer)/5;
}
Student(int id, String name, int english, int english1, int math, int math1, int computer)
{
this.id=id;
this.name=name;
this.english=english;
this.english1=english1;
this.math=math;
this.math1=math1;
this.computer=computer;
}
public void printData(){
System.out.println("id\t\t\t"+id);
System.out.println("name\t\t"+name);
System.out.println("english\t\t"+english);
System.out.println("english1\t"+english1);
System.out.println("math\t\t"+math);
System.out.println("math1\t\t"+math1);
System.out.println("computer\t"+computer);
System.out.println("average\t\t"+average());
}
}
public class y1{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(0,"學生0",92,87,74,68,80);
X[0].name="劉方立";
X[0].printData();
System.out.println();
Student []y=new Student[2];
y[0]=new Student(1,"學生0",92,87,74,68,80);
y[0].name="劉方立";
y[0].printData();
System.out.println();
Student []z=new Student[3];
z[0]=new Student(2,"學生0",92,87,74,68,80);
z[0].name="劉方立";
z[0].printData();
System.out.println();
Student []t=new Student[4];
t[0]=new Student(3,"學生0",92,87,74,68,80);
t[0].name="劉方立";
t[0].printData();
System.out.println();
Student []a=new Student[5];
a[0]=new Student(4,"學生0",92,87,74,68,80);
a[0].name="劉方立";
a[0].printData();
}
}
class Student {
private int id;
private String name;
private int english;
private int math;
private int computer;
private int chinese;
private int economies;
public 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;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("economies\t"+economies);
System.out.println("average\t"+average());
System.out.println("-----------------------");
}
}
public class StudentDataArray{
public static void main(String[] args) {
Student []X=new Student[1];
X[0]=new Student(01,"甲",60,48,76,82,60);
Student []Y=new Student[1];
Y[0]=new Student(02,"乙",82,62,70,67,73);
Student []Z=new Student[1];
Z[0]=new Student(03,"丙",96,98,44,63,100);
Student []C=new Student[1];
C[0]=new Student(04,"丁",60,98,37,77,96);
Student []T=new Student[1];
T[0]=new Student(05,"戊",88,73,78,94,83);
X[0].printData();
Y[0].printData();
Z[0].printData();
C[0].printData();
T[0].printData();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int PE;
private int chinese;
public 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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("PE\t"+PE);
System.out.println("chinese\t"+chinese);
System.out.println("average\t"+average());
}
}
public class java{
public static void main(String [] args){
Student []X=new Student[1];
X[0]=new Student(1,"學生",60,75,60,75,50);
Student []Y=new Student[2];
Y[0]=new Student(2,"學生2",65,75,50,65,85);
Student []Z=new Student[3];
Z[0]=new Student(3,"學生3",70,60,80,90,70);
Student []A=new Student[4];
A[0]=new Student(4,"學生4",65,50,75,65,60);
Student []B=new Student[5];
B[0]=new Student(5,"學生5",70,65,80,30,80);
X[0].printData();
System.out.println("-----------------------");
Y[0].printData();
System.out.println("-----------------------");
Z[0].printData();
System.out.println("-----------------------");
A[0].printData();
System.out.println("-----------------------");
B[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int english1;
private int math;
private int math1;
private int computer;
public float average(){
return ((float)english+english1+math+math1+computer)/5;
}
Student(int id, String name, int english,int english1, int math,int math1, int computer)
{
this.id=id;
this.name=name;
this.english=english;
this.english1=english1;
this.math=math;
this.math1=math1;
this.computer=computer;
}
public void printData(){
System.out.println("id\t\t\t"+id);
System.out.println("name\t\t"+name);
System.out.println("english\t\t"+english);
System.out.println("english1\t"+english1);
System.out.println("math\t\t"+math);
System.out.println("math1\t\t"+math1);
System.out.println("computer\t"+computer);
System.out.println("average\t\t"+average());
System.out.println("==================");
}
}
public class StudentDataArray{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(1,"學生0",60,50,66,72,70);
X[0].name="詹惠雯1";
X[0].printData();
Student []Z=new Student[2];
Z[0]=new Student(2,"學生0",55,61,53,68,72);
Z[0].name="詹惠雯2";
Z[0].printData();
Student []A=new Student[3];
A[0]=new Student(3,"學生0",63,50,66,73,64);
A[0].name="詹惠雯3";
A[0].printData();
Student []B=new Student[4];
B[0]=new Student(4,"學生0",58,71,58,64,70);
B[0].name="詹惠雯4";
B[0].printData();
Student []C=new Student[5];
C[0]=new Student(5,"學生0",62,53,64,72,71);
C[0].name="詹惠雯5";
C[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int PE;
public 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 printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("PE\t"+PE);
System.out.println("averge\t"+average());
System.out.println("---------------");
}
}
public class StudentDataArray {
public static void main(String[]args){
Student []X=new Student[1];
X[0]=new Student(0,"學生0",60,50,70,80,65);
Student []y=new Student[1];
y[0]=new Student(0,"學生0",60,77,70,81,70);
Student []z=new Student[1];
z[0]=new Student(0,"學生0",60,66,70,55,76);
Student []w=new Student[1];
w[0]=new Student(0,"學生0",60,61,79,64,72);
Student []v=new Student[1];
v[0]=new Student(0,"學生0",60,62,70,55,91);
X[0].printData();
y[0].printData();
z[0].printData();
w[0].printData();
v[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int english1;
private int math;
private int math1;
private int computer;
public float average(){
return ((float)english+english1+math+math1+computer)/5;
}
Student(int id, String name, int english, int english1, int math, int math1, int computer)
{
this.id=id;
this.name=name;
this.english=english;
this.english1=english1;
this.math=math;
this.math1=math1;
this.computer=computer;
}
public void printData(){
System.out.println("id\t\t\t"+id);
System.out.println("name\t\t"+name);
System.out.println("english\t\t"+english);
System.out.println("english1\t"+english1);
System.out.println("math\t\t"+math);
System.out.println("math1\t\t"+math1);
System.out.println("computer\t"+computer);
System.out.println("average\t\t"+average());
}
}
public class razer{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(0,"學生0",70,76,80,50,70);
X[0].name="陳瑞祥";
X[0].printData();
Student []A=new Student[2];
A[0]=new Student(1,"學生0",70,76,80,50,70);
A[0].name="陳瑞祥";
A[0].printData();
Student []Q=new Student[3];
Q[0]=new Student(2,"學生0",70,76,80,50,70);
Q[0].name="陳瑞祥";
Q[0].printData();
Student []W=new Student[4];
W[0]=new Student(3,"學生0",70,76,80,50,70);
W[0].name="陳瑞祥";
W[0].printData();
Student []E=new Student[5];
E[0]=new Student(4,"學生0",70,76,80,50,70);
E[0].name="陳瑞祥";
E[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="楊文良";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,80,83,50);
z[0].name="楊文良1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,79,78,77,70);
c[0].name="楊文良2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,70,70,83,70);
v[0].name="楊文良3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,79,70,88,50);
b[0].name="楊文良4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",62,70,70,83,70);
x[0].name="林婉吟";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,82,83,50);
z[0].name="林婉吟1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,69,78,77,70);
c[0].name="林婉吟2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,80,70,83,70);
v[0].name="林婉吟3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,79,60,88,50);
b[0].name="林婉吟4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",72,70,70,83,70);
x[0].name="陳秀雯";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,82,73,50);
z[0].name="陳秀雯1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,69,68,77,70);
c[0].name="陳秀雯2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,80,70,73,70);
v[0].name="陳秀雯3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,69,60,88,50);
b[0].name="陳秀雯4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",72,70,70,83,80);
x[0].name="康家紋";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,82,63,50);
z[0].name="康家紋1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,69,68,77,80);
c[0].name="康家紋2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,60,70,73,70);
v[0].name="康家紋3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",79,69,60,88,50);
b[0].name="康家紋4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="劉瑪塔";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,70,83,50);
z[0].name="劉瑪塔1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,79,68,97,70);
c[0].name="劉瑪塔2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",90,70,80,83,70);
v[0].name="劉瑪塔3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,100,70,88,50);
b[0].name="劉瑪塔4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int english1;
private int math;
private int math1;
private int computer;
public float average(){
return ((float)english+english1+math+math1+computer)/5;
}
Student(int id, String name, int english, int english1, int math, int math1, int computer)
{
this.id=id;
this.name=name;
this.english=english;
this.english1=english1;
this.math=math;
this.math1=math1;
this.computer=computer;
}
public void printData(){
System.out.println("id\t\t\t"+id);
System.out.println("name\t\t"+name);
System.out.println("english\t\t"+english);
System.out.println("english1\t"+english1);
System.out.println("math\t\t"+math);
System.out.println("math1\t\t"+math1);
System.out.println("computer\t"+computer);
System.out.println("average\t\t"+average());
}
}
public class kobe{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(0,"學生0",63,65,78,92,83);
X[0].name="梁庭嘉";
X[0].printData();
Student []A=new Student[2];
A[0]=new Student(1,"學生0",63,65,78,92,83);
A[0].name="梁庭嘉";
A[0].printData();
Student []B=new Student[3];
B[0]=new Student(2,"學生0",63,65,78,92,83);
B[0].name="梁庭嘉";
B[0].printData();
Student []C=new Student[4];
C[0]=new Student(3,"學生0",63,65,78,92,83);
C[0].name="梁庭嘉";
C[0].printData();
Student []D=new Student[5];
D[0]=new Student(4,"學生0",63,65,78,92,83);
D[0].name="梁庭嘉";
D[0].printData();
}
}
class Student{
private int id;
public String name;
private int english;
private int english1;
private int math;
private int math1;
private int computer;
public float average(){
return ((float)english+english1+math+math1+computer)/5;
}
Student(int id, String name, int english,int english1, int math,int math1, int computer)
{
this.id=id;
this.name=name;
this.english=english;
this.english1=english1;
this.math=math;
this.math1=math1;
this.computer=computer;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("english1\t"+english1);
System.out.println("math\t"+math);
System.out.println("math1\t"+math1);
System.out.println("computer\t"+computer);
System.out.println("average\t"+average());
System.out.println(" ");
}
}
public class StudentDataArray{
public static void main(String[] args){
Student []X=new Student[1];
X[0]=new Student(0,"學生0",68,70,84,62,90);
X[0].name="周欣蓓1";
X[0].printData();
Student []A=new Student[2];
A[0]=new Student(1,"學生0",62,90,74,69,50);
A[0].name="周欣蓓2";
A[0].printData();
Student []B=new Student[3];
B[0]=new Student(2,"學生0",88,77,59,72,82);
B[0].name="周欣蓓3";
B[0].printData();
Student []C=new Student[4];
C[0]=new Student(3,"學生0",48,73,64,44,30);
C[0].name="周欣蓓4";
C[0].printData();
Student []D=new Student[5];
D[0]=new Student(4,"學生0",98,60,54,42,55);
D[0].name="周欣蓓5";
D[0].printData();
}
}
class java{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",50,60,70,80,90);
x[0].name="林易緯";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",55,66,77,88,99);
z[0].name="林易緯1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",56,67,78,89,90);
c[0].name="林易緯2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",60,60,60,50,70);
v[0].name="林易緯3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",67,77,87,97,57);
b[0].name="林易緯4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="沈亨霖";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,80,83,50);
z[0].name="沈亨霖1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,79,78,77,70);
c[0].name="沈亨霖2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,70,70,83,70);
v[0].name="沈亨霖3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,79,70,88,50);
b[0].name="沈亨霖4";
b[0].printDate();
}
}
class Student
{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int statistic;
private int actuary;
public float average()
{
return ((float)english+math+computer+statistic+actuary)/5;
}
Student(int id,String name,int english,int math,int computer,int statistic,int actuary)
{
this.id=id;
this.name=name;
this.english=english;
this.math=math;
this.computer=computer;
this.statistic=statistic;
this.actuary=actuary;
}
public void printData()
{
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("computer\t"+computer);
System.out.println("statistic\t"+statistic);
System.out.println("actuary\t"+actuary);
System.out.println("average\t"+average());
}
}
class StudentDataArray
{
public static void main(String[] args)
{
Student []X=new Student[5];
X[0] = new Student(1,"學生1",80,75,78,73,72);
X[1] = new Student(2,"學生2",78,85,76,81,74);
X[2] = new Student(3,"學生3",82,71,77,79,75);
X[3] = new Student(4,"學生1",83,85,73,78,72);
X[4] = new Student(5,"學生5",87,83,79,73,71);
X[0].printData();
X[1].printData();
X[2].printData();
X[3].printData();
X[4].printData();
}
}
class Student
{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate()
{
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray
{
public static void main(String[] args)
{
Student []x=new Student[1];
x[0]=new Student(0,"學生0",80,78,96,92,74);
x[0].name="朱家威";
x[0].printDate();
Student []y=new Student[2];
y[0]=new Student(0,"學生0",88,86,92,74,70);
y[0].name="朱家威1";
y[0].printDate();
Student []z=new Student[3];
z[0]=new Student(0,"學生0",96,82,84,70,78);
z[0].name="朱家威2";
z[0].printDate();
Student []a=new Student[4];
a[0]=new Student(0,"學生0",92,74,80,88,86);
a[0].name="朱家威3";
a[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",84,70,88,96,82);
b[0].name="朱家威4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",80,70,70,83,70);
x[0].name="賴若瑜";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,79,83,50);
z[0].name="賴若瑜1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",88,79,68,77,70);
c[0].name="賴若瑜2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,90,70,83,60);
v[0].name="賴若瑜3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,80,70,88,50);
b[0].name="賴若瑜4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="李振綱";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,55,80,38,50);
z[0].name="李振綱01";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,79,75,72,70);
c[0].name="李振綱02";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,70,70,53,70);
v[0].name="李振綱03";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,79,70,44,52);
b[0].name="李振綱04";
b[0].printDate();
}
}
class java{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",50,60,70,80,90);
x[0].name="林易緯";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",55,66,77,88,99);
z[0].name="林易緯1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",56,67,78,89,90);
c[0].name="林易緯2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",60,60,60,50,70);
v[0].name="林易緯3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",67,77,87,97,57);
b[0].name="林易緯4";
b[0].printDate();
}
}
class b9933092{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",70,70,80,63,90);
x[0].name="張銘凱";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",56,86,90,83,70);
z[0].name="張銘凱1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",50,89,98,87,60);
c[0].name="張銘凱2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",50,50,70,83,70);
v[0].name="張銘凱3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",59,79,90,88,90);
b[0].name="張銘凱4";
b[0].printDate();
}
}
class Student{
private int id;
public String name;
private int english;
private int math;
private int computer;
private int chinese;
private int pe;
public 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 printDate(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("chinese\t"+chinese);
System.out.println("pe\t"+pe);
System.out.println("===================");
}
}
public class StudentDateArray{
public static void main(String[] args) {
Student []x=new Student[1];
x[0]=new Student(0,"學生0",60,70,70,83,70);
x[0].name="盧永霖";
x[0].printDate();
Student []z=new Student[2];
z[0]=new Student(0,"學生0",66,76,80,83,50);
z[0].name="盧永霖1";
z[0].printDate();
Student []c=new Student[3];
c[0]=new Student(0,"學生0",60,79,78,77,70);
c[0].name="盧永霖2";
c[0].printDate();
Student []v=new Student[4];
v[0]=new Student(0,"學生0",70,70,70,83,70);
v[0].name="盧永霖3";
v[0].printDate();
Student []b=new Student[5];
b[0]=new Student(0,"學生0",69,79,70,88,50);
b[0].name="盧永霖4";
b[0].printDate();
}
}
class Student{
private int id;
private String name;
private int english;
private int math;
private int computer;
private int PE;
private int chinese;
public 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\t"+id);
System.out.println("name\t"+name);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("PE\t"+PE);
System.out.println("chinese\t"+chinese);
System.out.println("average\t"+average());
}
}
public class java{
public static void main(String [] args){
Student []X=new Student[1];
X[0]=new Student(1,"好學生",70,86,81,65,87);
Student []Y=new Student[2];
Y[0]=new Student(2,"壞學生",55,72,74,56,87);
Student []Z=new Student[3];
Z[0]=new Student(3,"笨學生",75,65,51,55,47);
Student []A=new Student[4];
A[0]=new Student(4,"蠢學生",89,48,45,77,86);
Student []B=new Student[5];
B[0]=new Student(5,"傻學生",100,100,100,100,100);
X[0].printData();
System.out.println("-----------------");
Y[0].printData();
System.out.println("-----------------");
Z[0].printData();
System.out.println("-----------------");
A[0].printData();
System.out.println("-----------------");
B[0].printData();
}
}
class Student{
private int id;
private String name;
private int chinese;
private int english;
private int math;
private int computer;
public float average(){
return((float)chinese+english+math+computer)/5;
}
Student(int id,String name,int chinese,int english,int math,int computer)
{
this.id=id;
this.name=name;
this.chinese=chinese;
this.english=english;
this.math=math;
this.computer=computer;
}
public void printData(){
System.out.println("id\t"+id);
System.out.println("name\t"+name);
System.out.println("chinese\t"+chinese);
System.out.println("english\t"+english);
System.out.println("math\t"+math);
System.out.println("computer\t"+computer);
System.out.println("average\t"+average());
System.out.println("----------------------");
}
}
public class StudentDataArray{
public static void main(String[]args){
Student []X=new Student[5];
X[0]=new Student(0,"No.1學生",70,71,91,77);X[0].printData();
X[1]=new Student(1,"No.2學生",62,72,67,72);X[1].printData();
X[2]=new Student(2,"No.3學生",40,73,68,82);X[2].printData();
X[3]=new Student(3,"No.4學生",64,88,69,74);X[3].printData();
X[4]=new Student(4,"No.5學生",65,77,70,75);X[4].printData();
}
}
張貼留言