1967: Person-Student 二(choose one from C and D)

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:16 解决:4

题目描述

define a Person class as follows:

1)contains four data fields: name,addr,sex,age

2)define a no-arg constructor and a constructor with all data fields

3)add a toString method 

define a Student class extending Person class:

1) add new properties, math and english to denote the corresponding grade between 0 and 100

2)define a no-arg constructor and a constructor with all data fields

3)override toString method,which invokes toString method of Person class

输入

输入

there are many cases, for each case,input a student,in an order of name,addr,sex,age,math,english

输出

if math is not valid,output "wrong math grade";

if english is not valid,output "wrong english grade";

else,output the student's information as required

样例输入 复制

zhang sanming male 25 88 65
li hangzhou female 20 77 110
wang chongqing male 21 -5 78

样例输出 复制

zhang, sanming, male, 25 years old, math 88, english 65.
wrong english grade.
wrong math grade.