首页 >> 日常问答 >

java程序编写的心得体会(java程序编写)

2024-09-07 03:27:28

问题描述:

java程序编写的心得体会(java程序编写),急!求解答,求此刻有回应!

最佳答案

推荐答案

2024-09-07 03:27:28

大家好,我是小新,我来为大家解答以上问题。java程序编写的心得体会,java程序编写很多人还不知道,现在让我们一起来看看吧!

1、class Student{

2、 private String stuno ;

3、 private String name ;

4、 private float math ;

5、 private float english ;

6、 private float computer ;

7、 public Student(){}

8、 public Student(String stuno,String name,float math,float english,float computer){

9、 this.setStuno(stuno) ;

10、 this.setName(name) ;

11、 this.setMath(math) ;

12、 this.setEnglish(english) ;

13、 this.setComputer(computer) ;

14、 }

15、 public void setStuno(String s){

16、 stuno = s ;

17、 }

18、 public void setName(String n){

19、 name = n ;

20、 }

21、 public void setMath(float m){

22、 math = m ;

23、 }

24、 public void setEnglish(float e){

25、 english = e ;

26、 }

27、 public void setComputer(float c){

28、 computer = c ;

29、 }

30、 public String getStuno(){

31、 return stuno ;

32、 }

33、 public String getName(){

34、 return name ;

35、 }

36、 public float getMath(){

37、 return math ;

38、 }

39、 public float getEnglish(){

40、 return english ;

41、 }

42、 public float getComputer(){

43、 return computer ;

44、 }

45、 public float sum(){

46、 return math + english + computer ;

47、 }

48、 public float avg(){

49、 return this.sum() / 3 ;

50、 }

51、 public float max(){

52、 float max = math ;

53、 max = max>computer?max:computer ;

54、 max = max>english?max:english ;

55、 return max ;

56、 }

57、 public float min(){

58、 float min = math ;

59、 min = min<computer?min:computer ;

60、 min = min<english?min:english ;

61、 return min ;

62、 }

63、};

本文到此讲解完毕了,希望对大家有帮助。

  免责声明:本答案或内容为用户上传,不代表本网观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。 如遇侵权请及时联系本站删除。

 
分享:
最新文章