Mr. Rogers AP Computer Science A - First 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: How do you write a program?

Chapter 1 & 2: Software Basics

(AP Computer Science Standard: II Program Implementation, III Program Analysis, VI Computing in Context)

First Day

Introduction - Hand out syllabus

  1. Use console output (System.out.println)

Programming Assignment 1: Write a program that outputs "Hello World" to the screen.

  1. Define the term debugging.
  2. Define compiling error and describe a way to cause one.

Deliberately delete a ";" from the above program and note the error message. Deliberately alter other elements of the program to see what happens

Second Day

  1. Explain what compilers and interpreters do and why compiled code generally runs faster.
  2. Describe how Java's source code is compiled to byte code and then interpreted by the Java virtual machine work together.
  3. Give examples of different operating systems and explain why the Java virtual machine is needed.
  4. Define encapsulation and information hiding

Programming Assignment 2: Write a program that inputs (your name) and (your age) on the command line and outputs "Hello (your name) you are (your age) years old".

  1. Define run-time error and describe a way to cause one. (Usually throws an exception.)

Deliberately cause a run time error in  the above program and note what happens.

  1. Define the term iteration and describe a way to do it--example: pounding a nail, "for" loop

Programming Assignment 3: Modify Programming Assignment 2 with a "for loop" so that the message repeats itself 10 times. once the program is running, modify it so that it has an infinite loop and see what happens when you run it.

Sample code:

for (int x = 0; x < 10; x ++) {

    //Lines of code

}

  1. Define logic error and describe a way to cause one.
  2. Be aware that while a program can branch to a different part of the code or go round-and-round in a loop, it otherwise executes sequentially from the top to the bottom for a given method.
  3. Describe one of the key strategies in the creation of complex software: functional decomposition ( breaking down an overwhelmingly complex task into smaller doable tasks). Note: Creating a a software project of even a few hundred lines of code rapidly becomes complex if not overwhelming. The key to success is to take baby steps.
  4. Complete the first chapter of the AP Computer science case study GridWorld.
 

 

Assignments: The below assignments are to be completed within the first 10 days of school.

Homefun (summative/formative assessment):

GridWorld: Read Section 1; Do exercises 1-4. Note: you will not understand all of the terminology. Don't worry: your not supposed to. However, you'll find that if you don't let the jargon bother you, you can muddle through. In programming, muddling is a highly valued art.

Programming Assignment 4: Write a program which receives three input characters via command line input and outputs your printed initials in large size (at least 2 inches high) using the 3 input characters stored in string variables. Note: you need to write the initials on graph paper in order to know how many spaces to put between the string variables.

Example 1:

Input: "T", "K", "R"

Output:

T T T T T   K     K   R R R R
    T       K   K     R     R
    T       K K       R R R R
    T       K   K     R   R  
    T       K     K   R     R

Example 2:

Input: "X", "Y", "Z"

Output:

X X X X X   Y     Y   Z Z Z Z
    X       Y   Y     Z     Z
    X       Y Y       Z Z Z Z
    X       Y   Y     Z   Z  
    X       Y     Y   Z     Z

Read Sections: 2.1 to 2.3  

 

Essential Question: What is a computer?

    Chapter 1 & 2 (continued): Hardware Basics

    (AP Computer Science Standard: VI Computing in Context)

  1. Define the terms:
  1. State the basic types of gates and give logic tables for each. http://scitec.uwichill.edu.bb/cmp/online/P10F/logic_gates2.htm

3 Person Group Assignment:

  1. Create a digital circuit using gates that describes an activity (must use both "and" as well as "or" gates, 5 gates minimum).
  2. Create an xor gate from "not", "and" and "or" gates.
  1. Correctly identify and describe the functions of the following components.
  2.  

  3. Describe the function of ROM and the BIOS.
  4. Describe the function of a UPS (uninterrupted power supply, battery back up).
  5. Name the 2 most common I/O devices. (keyboard, monitor)
  6. Compare single user computer systems with Networks.

Read Sections: 1.1 to 1.4

Summative Assessment: Test Chap 1 & 2 Objectives 1-20


 

Essential Question: How are numbers, letters, and colors represented in computers?

Chapter 1 & 2 (continued): How Information is Represented

  1. Describe the following number systems: binary, decimal, and hexadecimal (see How to Count to 1,023 on Your Fingers).
  2. Convert binary to decimal numbers.
  3. Convert binary to hexadecimal numbers.  (see Hex Headquarters)
  4. Convert hexadecimal to binary.
  5. Convert hexadecimal to decimal numbers.
  6. State how characters are represented inside computers and give the name of the 2 types of code.

 

Code Type Bytes Possible Characters
ASCII 1 256
Unicode (used in Java) 2 65,536
  1. Describe how colors are commonly represented
  2. Given a quantity of bits specify the largest number which can be represented.
  3. Given a number of bits specify the largest number of objects or colors which can be specified.
Read Sections: 1.5 to 1.7
 
Homefun (summative/formative assessment):
Complete the Number Conversion and Unicode worksheet

 

Essential Question: What is the most important part of a piece of software's life cycle?
    Chapter 1 & 2 (continued): Software Design Basics

    (AP Computer Science Standard: I Object-Oriented Program Design)

  1. Use the two major computer program development tools.
  1. Use a flow chart to represent algorithms containing a loop
  1. Contrast procedural and object oriented programming. (Note: Java is object oriented.)
  1. List and explain the 6 phases of the Software System Life Cycle. Note that knowledge of the system's subject is often as important as knowledge of computing.
    • Analysis
    • Design
    • Coding
    • Testing/verification---gone awry ... lobster people !
    • Maintenance
    • Obsolescence

Prediction

In the near term future there will not be enough people with Computer Science degrees. The solution: Liberal Arts, Biology, Business, and other types of majors with any background in computing will be used to compensate. These people will have an increased number of job opportunities.

  1. Describe top-down design.
  2. Describe key strategies in the test phase.
  1. State the type of program used for delivering Java programs over the internet.
  2. Write a simple applet. (See AppletDemo Code. Run AppletDemo)

Read Chap. 2

 

Homefun (summative/formative assessment):

Exercises 1, 6, p. 38

Use a flow chart to represent algorithms containing a loop

Programming Assignments:

Summative Assessment: Test Chap 1 & 2 Objectives 1-18--come prepared to write an applet on paper


Chapter 3: Introduction to Classes & Objects

(AP Computer Science Standard: I Object-Oriented Program Design, II Program Implementation)

 

Essential Question: If a program has several million lines of code and is being worked on by people around the globe 24 hours a day, how do you prevent one part of the code from interfering with the other parts?
 
Class and Object  Features in Java
  1. Correctly use the following terms and be able to identify and use them in a program:

 

Programming Assignment (summative/formative assessment): Complete the Pumpkin Project as specified in the Farm class using the Pumpkin class.

 

Essential Question: How can you implement encapsulation and information hiding in ways that reduce the amount of source code?

Inheritance

  1. Explain how inheritance (uses the key word extends) works and why it is used.

    • superclass

    • subclass--"is-a" relationship (descendent relationship) examples: a car (subclass) is-a vehicle (superclass). A bus is-a vehicle. A truck is-a vehicle. The reverse is not true, for example, a vehicle is not a truck

 

Interfaces: Grades
  1. Explain the "has-a" relationship. (Used for defining fields)

client, characteristic, or component relationship examples: A car has a motor. A store has a customer. A girl has a name. A class has a field.

  1. Use "super" to call public methods of a super class from within a subclass.

super.calculateHours ( double starTime, double stopTime);

  1. Be aware that private fields in a superclass cannot be accessed in subclasses.

  2. Access a superclass's protected fields from a subclass by calling a get method for the field.

example : super.getWeight ( );  // returns the value of the protected
                                                 // weight field found in the 
                                          // superclass
  1. Explain the term "primitive data types" and give examples.

examples: int, char, double

  1. Name four classes contained in the java.lang package which is automatically imported into your java programs.

 
Read Chap. 3; Computational Thinking

 

Homefun (summative/formative assessment):
  1. Write brief definitions for the above terms in objectives 1 and 2. Use the textbook and the Sun Developer Network Glossary.

     

  2. Next find a program(s) with examples of each and identify them. You may use programs from the book, the internet, or ones you've written yourself. You may work as a group on part 2.

Programming Assignment: Exercise 9, 10, 12

Programming Assignment: Write an applet with a Student class, a School class and a Grades interface. The student class will have fields for name, test1, test2, and average grade. It's constructor will have parameters for initializing all the fields except average grade. The grades interface will have a method for calculating average grades. The student class will make use of the method that calculates average grade from the grades interface. The school is to have 3 students created in the school class and is to output all the school's information in a table as follow shown in the following example:

Name          Test 1       Test 2          Average Grade

Bob              50            100              75

Jane             90            100              95

Martha          80            90                85

 

Summative Assessment: Test Chap 3 Objectives 1- 8

Relevance: Knowledge of object oriented programs (OOPs) is a highly useful employment skill The degree breakdown for computer/math scientists

 


 
Chapter 4: Algorithms

(AP Computer Science Standard: III Program Analysis)

 
Essential Question: How does an algorithm compare to a mathematical model in physics or engineering?

 
What is an Algorithm
  1. Define the term algorithm.
  2. Correctly use recursion. Read the Barron's book write up on recursion. Click here for a simple example of recursion. Relevance: If you can do recursions you can learn to do anything in Comp Sci.
    • Must call itself within the method
    • Must alter one or more of its arguments each time it calls itself.
    • Must have a means of stopping itself based on the modified argument(s)

    • Stores calculated values in a stack and evaluates them after the recursion stops.

Programming Assignment: Write a program that inputs an integer n using command line input and uses it to calculate n factorial using recursion.
 
Programming Assignment: Write an application that finds and outputs Pi using recursion and the following series: Click here for 3 examples of recursion.

(Pi 2)/6 = 1 + 1/22 + 1/32 + ... + 1/n2

Input the number of times the recursion should run using command line input.

 

  1. Determine the number of iterations a given recursion will have.
  2. Define list in abstract terms. an abstract data structure that implements an ordered collection of values, where the same value may occur more than once. The simplest form of list is an array.
  1. Define traversal.
  2. The process of visiting (examining and/or updating) each node or item in a list.
  3. Compare sequential to binary search.
    Note: O(----) as shown below is called big O notation and indicates how run time will increase for as the amount of data items = n increases.
n 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00
log n 0.30 0.48 0.60 0.70 0.78 0.85 0.90 0.95 1.00
 
Read Chap. 4; Algorithms Should Mind Your Business, How To Think: Algorithmic Thinking, Read the Recursion section of the Barron's book. Read and study yet another Mr. Rogers' recursion example.

 

Homefun (summative/formative assessment):
    1) Exercises 1,  7, 9,
    2) Based on the reading assignments, write a 1/2 to one page paper explaining what algorithmic thinking is and how it differs from mathematical thinking.
Programming Assignment: Exercise 10
 
Summative Assessment: Test Chap 4 Objectives 1- 6
 
Relevance: Prior to the second half of the 21st century, the mathematical model particularly in physics was king as a method of predicting outcomes and solving problems. However, there are many problems which can only be solved with algorithms especially in the less mathematical sciences. Even in physics algorithms are required for solving chaos related problems.

 


 

Essential Question: What's the difference between style and syntax?

Chap. 5: Java Syntax and Style

(AP Computer Science Standard: II Program Implementation, III Program Analysis)

  1. Correctly use the three forms of comments:

  1. Identify reserved words (p. 107).

  2. Correctly use the naming conventions for classes, methods, and fields.

  1. Correctly indent programs.

Homefun (summative/formative assessment):
Read Chap. 5; Princeton professor foresees computer science revolution
Exercises 3, 4, 5, 7, 8, 10
Programming Assignment: Lab 5.6

 

Relevance: A program won't run without proper syntax. Proper style makes the code readable so that it can be modified and maintained.

 
Essential Question: Why did you learn to find remainders in grade school instead of going straight to long division ?

 

Chapter 6: Data Types, Variables, and Arithmetic

(AP Computer Science Standard: II Program Implementation, III Program Analysis)

  1. Understand the meaning and use of the equal sign in Java.

  1. Correctly declare fields and local variables.

  2. Correctly initialize fields, local variable, and parameters.

  3. State the default values used for initializing fields.

  1. State the default value used for initializing local variables. (there isn't one)

  2. State the eight types of primitive data types and their sizes in bytes. (p. 129)

  3. Explain why the largest size of an integer or long variable can be a major issue.

  4. Explain the limitations of precision on floating point data types and why these limitations can produce round-off errors.

  5. State the primitive data types which do not have a true zero and explain why this can be a problem.

  6. Correctly Use:

  1. Understand the term scope (p. 133). Note: the concept of scope is incredibly important to programming in Java. You must consider it whenever you create a variable. As a matter of style, variables should be declared at the top limit of their scope.

  1. Correctly convert numbers and objects into strings and explain why objects need special attention. (An object may have multiple variables or fields of different data types associated with them, hence the output has to be defined in order to understand how it should be done.)

Homefun (summative/formative assessment): read Sections 6.1 to 6.5; Exercises 1- 7 p.146-147

 

  1. Use literal constants as either int or doubles (Example: int: 2, double: 2.0).

  2. Correctly use the order of operation for arithmetic.

    1. parentheses

    2. division, multiplication, modulus

    3. addition, subtraction

  3. Perform division using integers and doubles.

Note: integer division truncates the decimal portion of a number. It does NOT round numbers. Mixed division of integers and doubles upgrades the answer to a double (this is called autoboxing).

Examples:
division of integers: 1 / 2       yields 0
division of doubles: 1.0 / 2.0 yields 0.5
mixed division:         1 / 2.0    yields 0.5,  1.0 / 2    yields 0.5  

 

  1. Truncate and round numbers using integer division.

Examples:
1/2 rounded to nearest whole number
((1*10) / 2 + 5) / 10  yields 1

 

y/x  rounded to nearest whole number
((y*10) / x + 5) / 10
  1. Cast variables.

Example:
int a, b;
double c;
c = (double) a / (double) b;
  1. Correctly use various arithmetic operators including:

  • modulus (%) returns remainder: 1 = 5 % 2

  • compound assignment operators (/=, +=, -=, *=, %=)

  • increment/decrement (y++, ++y, y--, --y)

 

Modulus Examples

1 = 1 % 3

2 = 2 % 3

0 = 3 % 3

1 = 4 % 3

2 = 5 % 3

0 = 6 % 3

 
Homefun (summative/formative assessment): Read Sections 6.6 to 6.10; Exercises 8, 10, 11 p.147-148
Programming Assignment: Lab 6.10, Exercises 12, 13 p.148

 

Programming Assignment: Write a program which uses command line input to input a single dimension in centimeters. Use this dimension to calculate and output the surface area and volume of a cube, sphere, and cylinder along with the correct units. The radius and height of the cylinder are equal to the dimension. Use a separate method for each calculation.

 

Relevance: Handling massive numbers of transactions involving money without losing anything to rounding errors is a major issue for international finance and businesses.

 
Essential Question: How does a progressive income tax system work and is it a good idea?

Tax code program:

Input: Using the command line input income in dollars. (This needs to be changed to cents inside the program.)

Output:

NTR = (taxDue) / (income) *100

Description: The program will round any tenths of a cent upward. "If" statements are not allowed. The program will use only algorithms to calculate taxes. It will use the following progressive tax table:

 
Income ($) Tax Rate Comments
        0 to 19,999.99  00 %

This part of income is never taxed

20,000 to 29,999.99 25 % Only income above $19,999.99 is taxed at 25%
30,000 +                    35 % Only Income above $29,999.99 is taxed at 35%. Note this is an additional 10% above the 25% tax that kicks in at $29,999.99.

 
Homefun (summative/formative assessment):

Practice Test

 

Summative Assessment: Test Chap 5 & 6 Objectives 1-22


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.