作业帮 > 综合 > 作业

java 考试题 请求各位大神帮个忙 能答多少 答多少 人多力量大 谢谢大家了。!!

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/11 01:06:55
java 考试题 请求各位大神帮个忙 能答多少 答多少 人多力量大 谢谢大家了。!!
1) Write a method that receives two int parameters and returns the smaller
of the two values. Call your method getSmaller.
2) Write a method that receives two String objects and returns true if the
two Strings start with the same character (ignoring case) and false
otherwise.
3) Using the Die class, write a method that will use two Die, roll them
100 times and return the number of times that the sum of the two is
7 or 11.
For questions 4 and 5, write the requested portions of a class called Employee.
4) An Employee will have a name, social security number, position, and
hourly wages. Define the instance data for this class.
5) Write a method that is passed the int value of the number of hours worked
for the week as a parameter, and returns the pay for the Employee,
including overtime, which is 1.5 * hourly wages for each hour over 40.
java 考试题 请求各位大神帮个忙 能答多少 答多少 人多力量大 谢谢大家了。!!
前两题,后面的继续给你写
public int getSmaller(int a,int b){
if(a40){
wages=(hour-40)*e.getHourlyWages()+40*e.getHourlyWages();
}else{
wages=40*e.getHourlyWages();
}
return wages;
}
第三题我再看看是什么意思