Mr. Rogers AP Computer Science A - Second Quarter Objectives

Syllabus
Syllabus 1st Quarter 2nd Quarter 3rd Quarter 4th  Quarter

Latin/Greek Root Words

arch--------->ancient, example: archtype;         chrono------>time, example: chronology;             -dom----------->quantity/state, example: freedom               fer-------->carry, example: transfer;               gen--------->birth, example: generate;                 luc-------->light, example lucid;                 neo--------->new, example: neonatologist;                olig--------->few, example: oligarchy;              omni--------->all, omniscient;            sym--------->together, symbol;

(Comp Sci connection)

 

Essential Question: Do we live in a binary world?

Chapter 7: Boolean Expressions and Conditional Control

  1. Define conditional control.

  2. Correctly use both if and if-else statements. (Be as one with the four Common if-else Errors on p. 156.)

  3. Draw flowcharts for both if and if-else statements.

  4. Correctly use boolean relational  operators. == ,  > ,  < ,  >= ,  <= ,  !=

  5. Correctly use boolean logical operators. && ,  || , !

  6. Given a set of  logic gates write the associated boolean expression (p. 3).

  7. Write truth tables for "and", "or", and "xor" gates.

  8. Evaluate complex boolean statements using correct order of operators (p. 163).

Highest
^
^
^
^
Lowest
    !          (unary) -      (cast)       ++           --
    *              /                 %
    +             -
   ==           <            <=               >             >=         !=
   &&
   ||
     
     
     
     
     
     
     
     
 
  1. Correctly describe and use short-circuit evaluation.

  2. Correctly use if-else-if tables for menus and selection processes like tax tables (see example code).

  3. Correctly use switch statements. (Be as one with the six points on p. 197)

  4.  
    Homefun (summative/formative assessment): 
    Exercises 1-7
     Practice Test
     
    Programming Assignments (summative/formative assessment):
    Lab 7.10, Lab 7.12; exercises 14, 17
    Tax Code Program II: rewrite the tax program entirely with if-else-if tables

Summative Assessment : Test Chap 11 Objectives 1-11


 

Essential Question: How can we access and perform similar manipulations on millions of volatile pieces of similar information without having to create millions of lines of code?

Chapter 8 Iterative Statements (Loops)

Relevance: Many if not most algorithms require loops. Loops are basic to all forms of computer science.

  1. State the 3 elements which must be present for any loop (p. 299).
  • initialization
  • testing
  • incrementing
  1. Correctly use the following loops (example code):

Loop Type

Example Comments
for
int x;
for (x = 0; x < n; x++) {
     ... code
}

Used when the number of times the loop needs to run is known

while
int x = 0;
while (x < n) {
     x++;
     ... code
}

 

Used when the number of times the loop needs to run is not known

do...while
int x = 0;
do {
     x++;
     ... code
} while (x < n);

Used when the number of times the loop needs to run is not known but must be at least once.

foreach
double y [ ] = new double [n];
for (double i: y) {
    ... code
}

Always runs exactly n times where n = size of list. Starts at list index of 0 and  increments upwards by one

  1. State which loop always runs at least once.
  2. State the most appropriate loop(s) to use when the number of iterations are known and when they are not known.
  3. Appropriately use break and return statements for ending loops.
  4. Correctly use loops for manipulating values in arrays.
  5. Correctly use nested loops.
  6. State the number of times each loop runs when using loops or nested loops.
  7. Be aware that a break statement in an inner loop will only break out of the inner loop.
  8. Use loops for the following programs:
    • even/odd numbers
    • factorials
    • fibonacci numbers
 
Homefun (summative/formative assessment):
Exercises 8, 9, 13

Practice Test

 
 
Programming Assignment (summative/formative assessment):
Lab 8.6; Exercise 10, 11, 12

Even numbers: write a program that outputs n even numbers. Use command line input to input the value of n. output 1 even number per line.

Fibonacci Numbers: write a program that outputs n fibonacci numbers. Use command line input to input the value of n. output 1 fibonacci number per line.

Prime numbers: write a program that outputs n prime numbers. Use command line input to input the value of n. output 1 prime number per line.

 

Summative Assessment: Test Chap 8 Objectives 1-12

 

 


 

Essential Question: Why use objects instead of just using variables?

Chapter 9: Implementing Classes and Using Objects

  1. Properly declare a class.

  2. Explain why fields are usually declared private and methods public.

  3. Correctly declare and initialize (generally with the new operator) objects

  4. Be as one with the nature of methods.

  1. Correctly write the header which declares a method inside a class.

access (public or private) returnType methodName (type parameterName1, ... type parameterNameN)

  1. Explain the terms precondition and post condition as they relate to methods and procedural abstraction.

  2. Explain how assertions and runtime exceptions are used in debugging, especially for reusable code.

  3. Correctly use comments with method declarations so that a programmer could use the method without knowing the details about how the code is implemented.

  4. Explain the nature of parameters.

  1. Explain the difference between an argument and a parameter.

  2. Correctly use overloaded methods. (Same name different arguments)

  1. Correctly use constructers.

  1. Correctly use copy constructors.

  2. State when the default constructer runs and how it initializes fields.

  1. Correctly use the "final" reserved word.

  2. Correctly initialize objects and use the new operator (p. 224).

Homefun: read Sections 9.1 - 9.5; Exercises 1-6

  1. State which type of fields can be accessed and what type methods can be called using a static method. (p. 223).

  1. State which type of fields can be accessed and what type methods can be called using an instance method (p. 223).

  1. Correctly call both static and instance methods (p. 226).

  1. Compare the two ways to pass arguments to methods and constructers (p. 230).

  1. Correctly use return statements.

Homefun (summative/formative assessment):
Read Sections 8.6 - 8.10; Exercises 8, 9, 13
 
Programming Assignment (summative/formative assessment):
Lab 8.6; Exercise 10, 11, 12

 

Summative Assessment: Test Chap 9 Objectives 1-20


 

 

Essential Question: How can we store and manipulate not just numbers but human text in a computer program?

Chap. 10 Strings

  1. Recognize literal strings.
  2. Be familiar with the 2 most common of String's 9 constructors.
  1. Be aware that Strings are immutable objects.
  2. Understand how Strings are initialized.
  1. Be aware that calling a String method with a String set to null will give run-time errors. (An empty string initialized to " " is not the same thing as a string initialized to null.)
  2. Correctly use common String methods (See table on p. 265.)
  1. Correctly use the various ways of doing concatenation (adding Strings). (p. 266)
  1. Correctly use relational operators with Strings. p. 268)
  2. CANNOT use == , != , < , >, <= , >=
  3. CAN use equals(s2), equalsIgnoreCase(s2), compareTo(s2) methods, compareToIgnoreCase (s2)
  4. Correctly convert numbers into Strings and Strings into numbers.

examples:

Integer.parseInt(yourString)

String.valueOf(yourNumber)

 

  1. Explain the term wrapper class. Wrapper classes allow primitive data types to be converted into objects or instances or vice versa.

Since ArrayLists need to contain objects, wrapper classes allow primitive data types to be stored in ArrayLists.

Primative Wrapper
boolean java.lang.Boolean
byte java.lang.Byte
char java.lang.Character
double  java.lang.Double
float java.lang.Float
int java.lang.Integer
long  java.lang.Long
short java.lang.Short
void java.lang.Void
  1. Correctly use the Character wrapper class methods. (p.275)
  • Integer(int value) Constructs a newly allocated Integer object that represents the specified int value.

Example: Integer CurrentInterger = intValue(12)

  • intValue()   Returns the value of this Integer as an int .

Example: int x = CurrentInterger.intValue()

 

  1. Correctly use the StringBuffer class (p. 278).

Homefun (summative/formative assessment): Exercises 1-6;
Programming assignments (summative/formative assessment): Lab 10.8

Summative Assessment: Test Chap 10 Objectives 1-13


 

Essential Question: How does OOP  development using Java compare with the process of writing a book using English?

Chapter 11: Class Hierarchies and Interfaces

  1. Name 2 reasons why duplicate code is a bad idea. (wasteful, hard to maintain)
  2. Explain the purpose of having a hierarchy of classes and how it helps facilitate functional decomposition ( breaking down an overwhelmingly complex task into smaller doable tasks).
  3. Define polymorphism and explain why it is useful (page 293).
  4. Create and use abstract methods (methods that are declared but not defined).
    Example declaration:
    public abstract int tax();  // Note that there is no code, not even brackets.
  5. Create abstract classes (classes with one or more abstract methods).
Example declaration:
public abstract class People {
     . . .
}
  1. Correctly declare an interface.
Example declaration:
public interface Career {
     . . .
}
  1. Define the term concrete class.

Has no abstract methods.

  1. Be aware that all classes automatically extend the class Object.
  2. State the difference between an interface, abstract class, and concrete class.
  3. Be aware that Java does not allow the creation of objects (instances) of an abstract class or an interface.
  4. Describe the reasons for using an interface.
  1. Be aware that if a class implements an interface (and it can implement as many as it wants), it must supply all the methods specified in the interface.
  2. Invoke a superclass's constructors (p.298).
  1. Write programs that extend a given class using inheritance.
  2. Write programs that implement interfaces.
  3. Explain how polymorphism applies to interfaces.

 

Homefun (summative/formative assessment): Exercises 1-5

Programming assignments: 6a

Summative Assessment: Test Chap 11 Objectives 1-15


 

Essential Question: How can we store millions of volatile pieces of similar information without having to create millions of variables in a computer program?

Chap. 12 Arrays and ArrayLists

  1. Correctly declare and initialize arrays.
  1. State the default values when initializing arrays
  1. Know that once declared and initialized, the size of an array cannot be changed.
  2. Know that the elements of arrays are numbered starting with 0. These elements can be randomly accessed using the indices or subscripts.
  3. Correctly use the array length field. example: array.length, note that strings use length()
  4. Be aware that arrays are always passed to methods by reference. When an object is passed by reference, the memory address of the starting point of the array is passed into the method. Any work done on the array by the method continues to exist after the method finishes running. It's not necessary to return an array to get values out of a method.

example of a method's parameters : addUp ( int incomes [ ]);

example of calling an : addUp ( incomes);

Note: the [ ] in the example indicates that an array is being passed to the method. Do not put the size of the array in the brackets.

  1. Correctly declare and initialize 2D arrays.
final int ROWS = 2;
final int COLS = 3;
double name2DArray [ ] [ ] = new double [ROWS][COLS];
    or
double name2DArray [ ] [ ] =
{
        {0.0, 2.7, 5.6},
        {4.3, 1.4, 7.2}
};
  1. Be aware that the first dimension in a two dimension array is considered the number of rows while the second dimension is the number of columns.
  2. Correctly use the length field to  find the number of rows and columns.
  1. Be aware that arrays with more than 2 dimensions can be declared.
  2. Correctly use parallel arrays.
  3. State the advantage of using ArrayList. Can expand and contract as needed
  4. Be familiar with ArrayList's constructors and methods (see page 331).
  5. Be aware of the pitfalls of using ArrayLists. They can only store objects or instances.
  6. Describe how classes and arrays are key elements used to form data structures.
  7. Describe why abstraction is an important theme in data structures.
  8. Be as one with Chapter 2 of GridWorld.
 
Homefun: Exercises 1-5;
Programming assignments: Lab 12.9, 12.11
 
12.1 Simple Data Base Program
Create a program with a class called Employees. In the main method create 3 parallel ArrayLists: 2 holding 6 first names and 6 last names plus a third ArrayList with the corresponding Salary for each employee. Use an output method concatenate the first and last names, and output the data in two columns as shown in the example:
 
Name                 Salary $1000/yr
Bob Arnold            90
Herb Bobo            12
Jane Cool             27
Alfred Nameless   49
Juan  Smith          200
Betty Taylor         142

Next, output the total of all salaries. Use a random number generator to fire two employees. Remove them from the Array List then add a new employee called Bob Newguy with a salary of $200,000. Again, output a table with the names of the current employees and their salaries. Also output the total of all salaries.

 

12.2 2-D Array Output
Create a program with a class called Alphabet with 3 local (inside main method) of 2-dimentional arrays: each will contain a large-sized letter respectively A, B, and C. Use a separate method to output the letters alphabetically in a column with A at the top.

Note: You need to write the letters on graph paper or in an Excel spread sheet in order to understand how many spaces are needed. To understand how the arrays should be initialized look at chapter 10 objective 7 above. You do not need to reproduce the grid lines in your program's output.

      
  0 1 2 3 4 5 6 7 8 9 10
0           A          
1         A   A        
2       A       A      
3     A A A A A A A    
4   A               A  
5 A                   A
     
 
GridWorld: Read Chapter 2, Exercises 1-4

Summative Assessment: Test Chap 12 Objectives 1-16


 

 

 

 

 

Mr

Mr. Rogers' Twitter Site

Check out other web sites created by Mr. R:

 

 

 
Want to learn more about movie physics in Star Trek and find out :
  • what makes Star Trek unique
  • how Star Trek compares to Star Wars
  • why the star ship Enterprise needs to remain in space
  • what should and shouldn't be done in space battles
  • what it takes to blast off and travel the galaxy
  • the basics of orbiting
Insultingly Stupid Movie Physics is one of the most humorous, entertaining, and readable physics books available, yet is filled with all kinds of useful content and clear explanations for high school, 1st semester college physics students, and film buffs.

It explains all 3 of Newton's laws, the 1st and 2nd laws of thermodynamics, momentum, energy, gravity, circular motion and a host of other topics all through the lens of Hollywood movies using Star Trek and numerous other films.

If you want to learn how to think physics and have a lot of fun in the process, this is the book for you!

 

First the web site,

now the book!


Mr. Rogers Home | Common Sylabus | AP Comp Sci I | AP Comp Sci II | AP Physics Mech | AP Physics E&M | AP Statistics | IB Design Tech | Southside

[ Intuitor Home | Physics | Movie Physics | Chess | Forchess | Hex | Intuitor Store |

Copyright © 1996-2009 T. K. Rogers, all rights reserved. Forchess ® is a registered trademark of T. K. Rogers.
No part of this website may be reproduced in any form, electronic or otherwise, without express written approval.