JAVA的问题(英文)

来源:百度知道 编辑:UC知道 时间:2024/06/06 20:09:14
Question 1
Write a class to represent a student. The constructor should take three parameters: a family name, a forename and an ID. All three parameters are set to be strings. Other data attributes are firstYearMark, secondYearMark and finalYearMark. In addition to the constructor, the other methods in the class should be:
a. ‘get’ methods for each of the attributes.
b. ‘set’ methods for each of the marks.
c. A method getTotalMark, which calculates and returns the student’s
total mark (the total marks for the three years).
In the same project, create a class with a main method which:
a. Prompts for data from the user for a first name, a family name and an ID.
b. Call a method validateID to check that the ID is exactly 6 characters
long and each of the characters is numeric.
c. If the ID is valid, create a student with the given information, then ask the
user to enter the three marks and call a method printStudent to disp

问题1
写一类,以代表一个学生。构造应采取三个参数:一个姓氏, forename和身份证。所有这三个参数的设定被弦乐团。其它数据属性是firstyearmark , secondyearmark和finalyearmark 。除了构造器外,其他方法在课堂应该是:
答: ' get '的方法,对于每一种属性。
乙'定'的方法,为每一种标志。
长一种方法gettotalmark ,计算并返回该学生的
总商标(总商标为三年) 。
在同一个项目,建立一个一流的一个主要方法,其中包括:
答:提示数据从用户第一个名字,姓氏和身份证。
乙所谓方法validateid检查身份证,正是6个字符
长期以来,每个字是数字。
长如果ID是有效的,营造一个学生在给定的资料,然后要求
用户进入3马克并呼吁方法printstudent展示
下列资料:
•学生的身份证件,姓氏和名字(就同一线) 。
•学生的总马克(上一条新的路线) 。
注:均validateid和printstudent须静态方法,在同类别中包含的主要方法。你可以利用该charat法在串级获得个性在弦,
长度法在串级,以了解有多少字符字符串,并character.isdigit ( ) ,以测试是否有一个字符是数字或不是。

好强...我点都看不懂,BUT I是计算机专业的