100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

Instructors Solutions Manual Introduction to Java Programming and Data Structures Comprehensive Version ABET Course ,Assessment ACM-IEEE Curricular 2013, UML Diagram Solution

Rating
-
Sold
-
Pages
60
Grade
A+
Uploaded on
08-08-2024
Written in
2024/2025

Instructors Solutions Manual Introduction to Java Programming and Data Structures Comprehensive Version ABET Course ,Assessment ACM-IEEE Curricular 2013, UML Diagram Solution

Institution
SolutionManual
Module
SolutionManual

Content preview

Sample Final Exam for CSCI 1301 (Java) Covers chapters 1-8


FINAL EXAM AND COURSE OUTCOMES MATCHING
COURSE OUTCOMES
Upon successful completion of this course, students should be able to
1. analyze and design strategies for solving basic programming problems.
2. use primitive data types, selection statements, loops, methods to write programs.
3. develop programs to solve a variety of problems in math, science, business, and
games.
4. use the step-wise refinement approach.
5. use arrays to store, process, and sort data.
6. use an IDE to develop programs.


Here is a mapping of the final comprehensive exam against the course outcomes:

Question Matches outcomes
Part I(a) 2
Part I(b) 2
Part I(c) 2
Part II(a) 2
Part II(b) 2
Part II(c) 2
Part II(d) 2
Part II(e) 2, 5
Part III(a) 1, 2, 3
Part III(b) 1, 2, 3, 4
Part III(c) 1, 2, 3, 4, 5
Part VI 1, 2, 3, 4, 5




1

, Name:__________________ CSCI 1301 Final
Armstrong Atlantic State University
Covers chs 1-8 Instructor: Dr. Y. Daniel Liang

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.

I pledge by honor that I will not discuss the contents of this exam with
anyone.

Signed by ___________________ Date ___________________


Part I. (2 pts each)
a. How many times is the following loop body repeated? What is the
output of the loop?
int i = 0;
while (i < 10) {
if ((i + 1) % 2 == 0)
System.out.println(i);

i++;
}

b. Convert the following for loop into a do-while loop.

int sum = 0;
for (int i = 0; i < 100; i++) {
sum += i;
}

c. Convert the following if statement using a switch statement

// Find interest rate based on year
if (numOfYears == 7)
annualInterestRate = 7.25;
else if (numOfYears == 15)
annualInterestRate = 8.50;
else if (numOfYears == 30)
annualInterestRate = 9.0;
else {
System.out.println("Wrong number of years");
System.exit(0);
}



Part II: Show the output of the following code:

a: (2 pts)

public class Test1 {
public static void main(String[] args) {
int i = 1;
while (i < 10) {
System.out.print(i + " ");
i = i + 3;



2

, }
}
}

b. (3 pts)
Suppose the input is 2 3 4 5 0. What is the output of the
following code?

import java.util.Scanner;


public class Test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

int number, max;
number = input.nextInt();
max = number;

while (number != 0) {
number = input.nextInt();
if (number > max)
max = number;
}

System.out.println("max is " + max);
System.out.println("number " + number);
}
}

c. (3 pts)
public class Test {
public static void main(String[] args) {
System.out.println(xMethod(5672));
}

public static int xMethod(int number) {
int result = 0;
while (number != 0) {
int remainder = number % 10;
result = result * 10 + remainder;
number = number / 10;
}

return result;
}
}


d. (3 pt)
public class Test {
public static void main(String[] args) {
int number = 0;
int[] numbers = new int[1];




3

, m(number, numbers);

System.out.println("number is " + number
+ " and numbers[0] is " + numbers[0]);
}

public static void m(int x, int[] y) {
x = 3;
y[0] = 3;
}
}



e. (3 pt) Suppose the input is 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3
4. What is the output of the following code?
import java.util.Scanner;

public class Test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

double[][] m = new double[4][4];

for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
m[i][j] = input.nextDouble();

System.out.print(ttt(m));
}

public static int ttt(double[][] m) {
int sum = 0;

for (int i = 0; i < m.length; i++)
sum += m[i][i];

return sum;
}
}




4

Written for

Institution
SolutionManual
Module
SolutionManual

Document information

Uploaded on
August 8, 2024
Number of pages
60
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
StuviaGuides West Virgina University
Follow You need to be logged in order to follow users or courses
Sold
15852
Member since
6 year
Number of followers
8357
Documents
5619
Last sold
4 hours ago
Accounting, Finance, Statistics, Computer Science, Nursing, Chemistry, Biology &amp; More — A+ Test Banks, Study Guides &amp; Solutions

As a Top 1st Seller on Stuvia and a nursing professional, my mission is to be your light in the dark during nursing school and beyond. I know how stressful exams and assignments can be, which is why I’ve created clear, reliable, and well-structured resources to help you succeed. I offer test banks, study guides, and solution manuals for all subjects — including specialized test banks and solution manuals for business books. My materials have already supported countless students in achieving higher grades, and I want them to be the guide that makes your academic journey easier too. I’m passionate, approachable, and always focused on quality — because I believe every student deserves the chance to excel.

Read more Read less
4.3

2247 reviews

5
1540
4
298
3
178
2
72
1
159

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions