1 / 18
文档名称:

FinalExam(Ch1-7).doc

格式:doc   大小:127KB   页数:18页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

FinalExam(Ch1-7).doc

上传人:mh900965 2017/12/2 文件大小:127 KB

下载得到文件列表

FinalExam(Ch1-7).doc

相关文档

文档介绍

文档介绍:Final exam and Course es matching
Course es
Upon pletion of this course, students should be able to
Will be able to write programs using primitive data types, variables, and expressions.
Will be able to write programs using selection statements.
Will be able to write programs using loop statements.
Will be able to write programs using methods.
Will be able to write programs using single-dimensional arrays.
Will be able to write programs using multidimensional arrays.
Will be able to solve problems using programs.
Here is a mapping of the prehensive exam against the course es:
Question
Matches es
Part I(a)
3
Part I(b)
3
Part I(c)
2
Part II(a)
3
Part II(b)
3
Part II(c)
4
Part II(d)
5
Part II(e)
6
Part III(a)
1, 7
Part III(b)
4, 7
Part III(c)
5, 7
Part VI
1, 2, 3, 4, 5, 6, 7
Name:__________________
Covers chs 1-7
CSCI 1301 Final
Armstrong Atlantic State University
Please note that the university policy prohibits giving the exam score by email. If you need to know your final exam score, come to see me during my office hours next semester.
Part I. (2 pts each)
a. How many times is the following loop body repeated? What is the printout of the loop?
int i = 0;
while (i < 10) {
if ((i + 1) % 2 == 0)
(i);
i++;
}
Convert the following for loop into a do-while loop.
int sum = 0;
for (int i = 0; i < 100; i++) {
sum += i;
}
Convert the following if statement using a switch statement
// Find interest rate based on year
if (numOfYears == 7)
annualInterestRate = ;
else if (numOfYears == 15)
annualInterestRate = ;
else if (numOfYears == 30)
annualInterestRate = ;
else {
("Wrong number of years");
(0);
}
Part II: Show the printout of the following code:
a: (2 pts)
public class Test1 {
public static void main(String[] args) {
int i = 1;
while (i < 10) {
(i + " ");
i = i + 3;
}
}
}
b. (3 pts)
Suppose the inpu