To Exam Info
IT 212 -- Final Review Guide
Bring to Final:
Final Exam Format
- Multiple Choice Questions:
You are allowed to give reasons or show your work to
justify your answers for partial credit. If your answer is correct, the reasons will not be considered.
- Find errors in Python modules.
- Find errors in Java classes. The equivalent Python scripts without errors will be supplied for reference.
Definitions:
- datatypes (str, int, float, bool, list, dict),
f-string, string format method, format specifiers ({0:d},
{1:03d}, {2:f}, {3:5.3f}, {4:s}), standard out (print), standard in
(input), logical operators (and, or,
not), file methods (readline,
readlines, read, close),
control structures (if..elif, while, for),
str constant
delimiters ('...', "...",
'''...''', """..."""),
string escape characters ( \n, \t, \a, \f, \\, \", \', \s ),
class, object, instance variable, standalone method, instance method, accessibility (public, private),
constructor, dunder methods (__init__, __str__, __repr__,
__lt__, __eq__), UML diagram, testing (traditional, unit testing), inheritance, overridden method,
is-a test, base class (superclass, parent class), derived class (subclass, child class),
super to invoke method from base class, arrays of objects, dictionary object,
regular expressions, Python module (import,
from ... import), interpreted vs. compiled language,
SQLite3, Python sqlite3 module (connect,
cursor, execute, commit, fetchall, close), Java.
Builtin Methods
Java Keywords and Methods
- import class public static void main { ... }
System.out System.in println print System.exit(0)
if ... else while for int double boolean
String
Java if Statements
if(condition) {
action;
}
if(condition)
{
action1;
}
else
{
action2;
}
if(condition1)
{
action1;
}
else if(condition2)
{
action2;
}
else
{
default action;
}
Java Loops
while(condition)
{
action;
}
for(initialization; condition; iteration)
{
action;
}
Concatenation vs. String.format for Java Output
// Concatenation
System.out.println(name + " " + gender + " " + age);
// String.format
System.out.println(String.format("%s %c %d",
name, gender, age);
// or
// String.format
System.out.printf("%s %c %d", name, gender, age);
Java User Defined Methods
public static returnDatatype methodName(param1, ... , paramn) {
// body of method
// return output; // (if not void)
}
Be Able To
- Answer multiple choice questions giving reasons to explain your choices.
- Construct a variable trace and predict the output for a Python script. This may involve classes and objects.
- Find errors in a Python script.
- Convert a traditional test script to a unit test script.
- Explain what a method does.
- Explain which strings a regular expression accepts.
- Predict the output of a Python expression that uses the regular expression methods
search, sub, and split from the
re module.
- Find errors in Java source code. You will be given the equivalent Python script for comparison.
- Predict the output of a Java program.
- Explain the difference between an interpreted script and a compiled program.
- Understand the similarities and differences between Python and Java.