TB 100
Lewis/Loftus/Cocking: Chapter 9 Test Bank
Chapter 9: Data Structures
Test Bank
Multiple Choice Questions:
1) An array can be classified as what type of object?
a) dynamic
b) ordered
c) first-in first-out
d) heteogeneous
e) collection
Answer: e. Exp
Lewis/Loftus/Cocking: Chapter 6 Test Bank
TB 59
Chapter 6: Arrays
Test Bank
Multiple Choice Questions:
For questions 1-4, assume values is an int array that is currently filled to capacity, with the following values:
9
4
12
2
6
8
18
1) What is returned by
Lewis/Loftus/Cocking: Chapter 7 Test Bank
TB 71
Chapter 7: Inheritance
Test Bank
Multiple Choice Questions:
For questions 1 4, use the following partial class definitions:
public class A1
cfw_
public int x;
private int y;
public int z;
public class A2 ex
TB 86
Lewis/Loftus/Cocking: Chapter 8 Test Bank
Chapter 8: Recursion
Test Bank
Multiple Choice Questions:
For questions 1 2, use the following recursive method.
public int question1_2(int x, int y)
cfw_
if (x = y) return 0;
else return question1_2(x-1, y)
Advanced Programming Concepts
You will learn how advanced
programming constructs and
concepts are implemented in C.
This includes low level operations
and system calls.
James Tam
Variable Types
Simple (atomic)
- Cant be subdivided further into meaningful
<html><head></head><body><pre style="word-wrap: break-word; white-space: prewrap;">/import java.util.Math;
public class BankAccountTestcfw_
public StringBuffer message = new StringBuffer();
public int numOfTests = 0;
public int numOfTestsPassed = 0;
priva
The Introduction to multidisciplinary Computer Science II by James Tam
Return to the course web page
CPSC 219: Assignment 1
New Concepts to be applied for the assignment
Homogeneous lists: ('C' style arrays)
Using low level (bit level) operations in order
Course web page: Introduction to multidisciplinary Computer Science II by Return to the course web page
James Tam
Information About The Second Midterm Exam
Additional details will be provided as we get closer to the exam so you should check this page for
Course web page: Introduction to multidisciplinary Computer Science II by Return to the course web page
James Tam
Information About The Final Exam
Additional details will be provided as we get closer to the exam so you should check this page for updates.
Course web page: Introduction to multidisciplinary Computer Science II by Return to the course web page
James Tam
Information About The First Midterm Exam
Additional details will be provided as we get closer to the exam so you should check this page for u
<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">public
class ChequingAccountTest extends ExerciseTest cfw_
private int accountCounter = 0;
public boolean test1()cfw_
testInfo(1, "Default Construction", "Balance should b
public class MultiplyQuestionTest extends ExerciseTest cfw_
public boolean test1()cfw_
testInfo(1, "Create 1/2 * 3/4", "String should be '1/2 x 3/4 = '");
Fraction f = new Fraction(1,2);
Fraction f2 = new Fraction(3,4);
Question q = new MultiplyQuestion(f
import java.util.Random;
import java.util.Scanner;
/*
* Manages and runs a quiz with fraction questions.
*/
public class Quiz cfw_
private Question[] questions;
/*
* Creates a quiz with the specified number of fraction questions.
* The questions are rando
/*
* An abstract notion of a question involving fractions.
*/
public abstract class Question cfw_
private Fraction f1;
private Fraction f2;
/*
* Creates a question involving two fractions.
* @param first the first fraction for the question.
* @param secon
/*
* Represents a fraction with a numerator and denominator. The denominator
* can never be zero. The fraction will always be stored in simplified format.
*/
public class Fraction cfw_
private int numerator = 0;
private int denominator = 1;
/*
* Creates t