|
Mr. Rogers AP Computer Science A - First Quarter Objectives |
| Syllabus | 1st Quarter | 2nd Quarter | 3rd Quarter | 4th Quarter |
|
| 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
Programming Assignment 1: Write a program that outputs "Hello World" to the screen.
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
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".
Deliberately cause a run time error in the above program and note what happens.
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.
- Go to the College board site and download the... Student Manual (.pdf/630KB)
- Download the................................................................. Code (.zip/238KB)
- Download and follow the............................................. Installation Guide (.pdf/172KB) for Bluej
Assignments: The below assignments are to be completed within the first 10 days of school.
GridWorld: Read Chapter 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 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:
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 T K K R R T K K R R
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)
- and
- or
- xor
- stand-alone applications (single user)--word processors, spread sheets, etc.
- information sharing and communication--various mark up languages such as html (used on web pages),
- distributed software--applets (use java language), java scripts (not java!), server side software, etc
- cluster computing--Beowulf systems, SETI
Read Sections: 1.1 to 1.4
Test: Chap 1 & 2 Objectives 1-19
| Essential Question: How are numbers, letters, and colors represented in computers? |
Chapter 1 & 2 (continued): How Information is Represented
Code Type Bytes Possible Characters ASCII 1 256 Unicode (used in Java) 2 65,536
| Essential Question: What is the most important part of a piece of software's life cycle? |
(AP Computer Science Standard: I Object-Oriented Program Design)
- Pseudo code
- Flow Charts
|
|
- isolation testing--classes and libraries are tested separately
- boundary condition testing--boundaries are identified and used for generating test data.
- integration testing--all of the software's components are combined and tested as a unit
Test: Chap 1 & 2 Objectives 1-17
| 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? |
(AP Computer Science Standard: I Object-Oriented Program Design, II Program Implementation)
Correctly use the following terms and be able to identify and use them in programming:
API (Applications Programming Interface)--the ultimate source of information for reusable Java code.
packages
fully-qualified name - Library.package.class example: javax.swing.JButton ( means JButton class)
wild card - *
methods (instance, static)
parameters
arguments
constructor (called with new operator when the object is created and allocated RAM)
field (primitives or objects)
instance
object
static
event
listener
interface
classes
Explain how inheritance works and why it is used.
superclass
subclass--"is-a" relationship (descendent relationship) example: a car (subclass) is a vehicle (superclass)
Explain the "has-a" relationship.
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.
Explain the term "primitive data types" and give examples.
Name four classes contained in the java.lang package which is automatically imported into your java programs.
System
Math
Object
String
Programming Assignment: Write an applet with 2 classes a Student class and a School class. 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 student class will also have a method that calculates average grade. 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
| Essential Question: How does an algorithm compare to a mathematical model in physics or engineering? |
(AP Computer Science Standard: III Program Analysis)
Must modify its argument
Programming Assignment: Write a program that finds and outputs Pi using recursion and the following series:
(Pi 2)/6 = 1 + 1/22 + 1/32 + ... + 1/n2
Input the number of times the recursion should run using command line input.
- items numbered
- method for accessing the i th item is defined
| 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)
Correctly use the three forms of comments:
// Single line comment
/* One or more lines of comments*/
/** Javadoc comments*/
Identify reserved words (p. 107).
Correctly use the naming conventions for classes, methods, and fields.
Capitalize the first letter of classes but not methods or fields.
The first character must be a letter & have no spaces in it.
Names can include letters, numbers or the underscore_.
Names should be descriptive.
Method names = verbs, field = nouns
Constants use all capitals.
Correctly indent programs.
| 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)
Understand the meaning and use of the equal sign in Java.
Can have only one field or variable on the left side
Means "replaced by", not equals
Correctly declare fields and local variables.
Correctly initialize fields and local variable.
State the default value used for initializing fields.
State the default value used for initializing local variables.
State the eight types of primitive data types and their sizes in bytes.
Explain why the largest size of and integer of long can be a major issue.
Explain the limitations of precision on floating point data types and why these limitations can produce round-off errors.
State the primitive data types which do not have a true decimal point and explain why this can be a problem.
Correctly Use:
literal constant - letters in single quotes and numbers
symbolic constant - declared and initialized using final
escape sequences (p.146, \n newline, \t tab, \\slash, etc.)
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.
inside a class
inside {}
inside a method
Correctly convert numbers and objects into strings.
Homefun: read Sections 6.1 to 6.5; Exercises 1- 7 p.146-147
Perform integer division.
Truncate and round numbers using integer division.
Cast variables.
- Example:
- int a, b;
- double c;
- c = (double) a / (double) b;
Use literal constants as either int or doubles (Example: 2, 2.0).
Correctly use various arithmetic operators including:
modulus (%)
compound assignment operators (/=, +=, -=, *=, %=)
increment/decrement (y++, ++y, y--, --y)
Correctly use the order of operation for arithmetic.
parentheses
division, multiplication, modulus
addition, subtraction
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.
| 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:
Taxable income in dollars
Tax due in dollars (round tenths of cents upward)
Nominal tax rate in % of income
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. |
Test: Chap 5 & 6 Objectives 1-25