- 9
- 0
- 约2.78万字
- 约 25页
- 2015-09-26 发布于北京
- 举报
国外大学JAVA考试题2010SSExamAnswers
Question/Answer Sheet CompSci101
THE UNIVERSITY OF AUCKLAND
SUMMER SEMESTER, 2010
Campus: City
COMPUTER SCIENCE
Principles of Programming
(Time Allowed: TWO hours)
NOTE:
You must answer all questions in this exam.
No calculators are permitted
Answer in the space provided in this booklet.
There is space at the back for answers that overflow the allotted space.
Surname
Forenames
Student ID
Login (UPI)
Q1 Q4 Q7 Q10
(/10) (/9) (/8) (/10)
Q2 Q5 Q8
Total
(/10) (/10) (/12)
Q3 Q6 Q9
/100
(/10) (/15) (/6)
Question/Answer Sheet - Page 2 - CompSci 101
ID:
Question 1 (10 marks)
a) What is the output when the following code is executed?
String result = 1 + 1 + + + 6 / 5 + 1 + 8 / (2 + 1);
System.out.println(result);
2 + 1 1 2
(2 marks)
b) Give ALL the possible outputs when the following code is executed?
int random = (int) (Math.random() * 4 + 3);
System.out.println(random);
3, 4, 5, 6
您可能关注的文档
最近下载
- 2025年拍卖师处理委托人疑虑与期望管理的咨询方法专题试卷及解析.pdf VIP
- 用户手册_财务_第二册.doc VIP
- 机场商业业态的智能布局与旅客消费行为引导策略.pdf VIP
- 2025年无人机驾驶员执照飞行日志中起降数据的记录与分析专题试卷及解析.pdf VIP
- 2025年无人机驾驶员执照安全审计绩效评估专题试卷及解析.pdf VIP
- 2025年AWS认证CloudWatch警报全生命周期管理与持续优化专题试卷及解析.pdf VIP
- 2025年演出经纪人艺人合同中的合同履行中的法律文书存储专题试卷及解析.pdf VIP
- 《哲学的指引 :斯多葛哲学的生活之道》马西莫·匹格里奇【文字版_PDF电子书_下载】.pdf VIP
- 低温等离子体多功能手术系统技术参数.docx VIP
- 用户手册_财务_第一册.doc VIP
原创力文档

文档评论(0)