100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada
logo-home
Instructors Solutions Manual Introduction to Java Programming and Data Structures Comprehensive Version ABET Course ,Assessment ACM-IEEE Curricular 2013, UML Diagram Solution 17,03 €   Añadir al carrito

Examen

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

 10 vistas  0 compra
  • Grado
  • SolutionManual
  • Institución
  • SolutionManual

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

Vista previa 4 fuera de 60  páginas

  • 8 de agosto de 2024
  • 60
  • 2024/2025
  • Examen
  • Preguntas y respuestas
  • SolutionManual
  • SolutionManual
avatar-seller
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

Los beneficios de comprar resúmenes en Stuvia estan en línea:

Garantiza la calidad de los comentarios

Garantiza la calidad de los comentarios

Compradores de Stuvia evaluaron más de 700.000 resúmenes. Así estas seguro que compras los mejores documentos!

Compra fácil y rápido

Compra fácil y rápido

Puedes pagar rápidamente y en una vez con iDeal, tarjeta de crédito o con tu crédito de Stuvia. Sin tener que hacerte miembro.

Enfócate en lo más importante

Enfócate en lo más importante

Tus compañeros escriben los resúmenes. Por eso tienes la seguridad que tienes un resumen actual y confiable. Así llegas a la conclusión rapidamente!

Preguntas frecuentes

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

100% de satisfacción garantizada: ¿Cómo funciona?

Nuestra garantía de satisfacción le asegura que siempre encontrará un documento de estudio a tu medida. Tu rellenas un formulario y nuestro equipo de atención al cliente se encarga del resto.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller solutions. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for 17,03 €. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

45,681 summaries were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Empieza a vender
17,03 €
  • (0)
  Añadir