阅读以下说明和Java代码,将应填入 (n) 处的字句写在答题纸的对应栏内。
【说明】
java.util包中提供了HashMap模板类,该模板类可以表示多个“键-值”对的集合,其中 “键” 的作用与普通数组中的索引相当,而 “值” 用作待存储和检索的数据。 HashMap实现了Map接口。在Map接口中定义了put和get方法,put方法表示Map对象中加入一个“键-值”对,get方法则通过“键”来获取其对应的“值” 。
下面的Java代码中使用了HashMap模板类,将编号为1001、1002、1003的员工信息插入到HashMap对象中,然后输入一个指定的员工编号,通过员工编号来获取员工的基本信息。员工编号为整型编码,而员工的基本信息定义为类employee。
HashMap对象与员工对象之间的关系及存储结构如图6-1所示。
【Java 代码】
import javA.util.*;
class employee{
employee(String name,String phoneNumber, String address){
this.name = name;
this.phoneNumber = phoneNumber;
this.address = address;
}
String name;
String phoneNumber;
String address;
};
public class javaMain {
public static void main(String[] args) {
Map<Integer, employee> employeeMap = new HashMap<Integer, employee>();
for (Integer employIndex = 1001; employIndex <= 1003; employIndex++){
String tmp = employIndex. (1) ();
employeeMap. (2) (employIndex, (3) ("employee-"+tmp,
"85523927-"+tmp,
"address-"+tmp
)
); //将员工编号和员工信息插入到employeeMap对象中
}
int employeeNo = 0;
System.out.print("请输入员工编号:");
Scanner s= new Scanner(System.in);
employeeNo = s.nextInt(); //从标准输入获得员工编号
employee result = employeeMap. (4) (employeeNo);
if ( (5) == null)
{
System.out.println("该员工编号不存在 !");
return;
}
System.out.println("你所查询的员工编号为:" + employeeNo);
System.out.println("该员工姓名:" + result.name);
System.out.println("该员工电话:" + result.phoneNumber);
System.out.println("该员工地址:" + result.address );
}
}
(1)toString (2) put (3) new employee (4) get (5)result
本题主要考查Java程序设计语言中类库的使用。空缺(1)处需要将employIndex转化为字符串,因此可以使用整型数的toString方法;空缺(2)和(3)处的代码是希望构造出employee对象,并把新构造出的对象及其对应的编号加入到HashMap类的实例employee -Map中,而HashMap的put方法可完成插入编号和员工对象的功能,因此空缺(2)处需要填写put方法,空缺(3)处需要使用new构造一个新的 employee对象;空缺(4)处主要是使用employeeMap对象根据员工号码查找员工信息,可使用HashMap中的get方法,该方法查询到员工信息后将放入result引用中,若没有查到,result将为空。
( )is that it provides guidance and direction on how quality will be managed and verified throughout the project.
( )the process of determining,documenting,and managing stakeholder needs and requirements to meet Project objectives.
The information security management system preserves the confidentiality,integrity and availability of information by applying a( ).
( )is a decentralized database,ensure that the data will not be tampered with and forged.
( )puts computer resources on the web,and must meet the requirements of super capacity,super concurrency,super speed and super security.
分配甲、乙、丙、丁四个人去完成五项任务。每人完成各项任务时间如表所示。由于任务多于人数,故规定其中有一个人可兼完成两项任务,其余三人每人完成一项。为了花费时间最少,( )应该完成两项任务。
已知某公司生产AB两种产品,其中生产1件A产品需要1个单位的甲资源,3个单位的丙资源;生产1件B产品需要2个单位的乙资源和2个单位的丙资源。已知现有甲乙丙三种资源4个单位、12个单位和18个单位。通过市场预测,可知A产品的单位市场利润为2元,B产品的单位市场利润为5元。该公司获得最大的市场利润应生产A产品(68)件,此时(69)资源仍有剩余。
已知某公司生产AB两种产品,其中生产1件A产品需要1个单位的甲资源,3个单位的丙资源;生产1件B产品需要2个单位的乙资源和2个单位的丙资源。已知现有甲乙丙三种资源4个单位、12个单位和18个单位。通过市场预测,可知A产品的单位市场利润为2元,B产品的单位市场利润为5元。该公司获得最大的市场利润应生产A产品(68)件,此时(69)资源仍有剩余。
某项目2016年投资额12万元,2018年开始取得项目的净收益(产品一原料辅料及公用工程)6万元/年,2018-2021年每年还会产生其他成本(包括人员工资、管理成本、制造成本等)1.1万元/年;増值税0.35万元/年、营业税金及附加0.05万元/年。则该项目的静态投资回收期为(66)年,截止到2021年底该项目的投资收益率是(67)。
安全审计的手段主要包括( )。