Mr. Rogers AP Computer Science A - Q1 Objectives
3) State the basic types of gates and give logic tables for each. http://scitec.uwichill.edu.bb/cmp/online/P10F/logic_gates2.htm
5) State the common way that circuit boards are damaged and 2 ways to avoid it.
6) Describe the function of ROM and the BIOS.
7) Describe the function of a UPS.
8) State the function of the bus.
9) Name the 2 most common I/O devices.
10) State the difference between volatile and non volatile memory.
Programming Assignment Write a program which receives three input characters and outputs your printed initials in large size (at least 2 inches high)
11) Convert binary to decimal numbers.
5) State the type of program used for delivering Java programs over the internet.
6) Write a simple applet.
Assignment: read Chap. 3
Homefun 7-12 p.89
Programming Assignment 15, 16 p.90
Introduction to Classes Objects Events
Correctly use the following terms:
API (Applications Programming Interface)
fully-qualified name - Library.package.class example: javax.swing.JButton ( means JButton class)
wild card - *
methods (instance, static)
constructor (called with new operator when the object is created and allocated RAM)
field (primitives or objects)
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.
Homefun read Chap. 4 1-6 p.114-115,
Write brief definitions for the above terms.
Programming Assignment 9, 10, 12 p. 117
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.
Java Syntax and Style
Correctly use the three forms of comments:
// Single line comment
/* One or more lines of comments*/
/** Javadoc comments*/
Identify reserved words (p. 125).
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.
Homefun read Chap. 5; Exercises 3, 4, 5, 7, 8, 10 p.136-137
Programming Assignment Lab 5.6 p. 133
|Essential Question: Why did you learn to find remainders in grade school instead of going straight to long division ?|
Data Types, Variables, and Arithmetic
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 (p. 145).
State the primitive data types which do not have a true decimal point.
Correctly Use (p.146):
literal constant - numbers and letters in single quotes
symbolic constant - declared and initialized using final
escape sequences (p.146, \n newline, \t tab, \\slash, etc.)
Understand the term scope (p. 149).
inside a class
inside a method
Homefun read Sections 6.1 to 6.5; Exercises 1- 7 p.165-166
Perform integer division.
Truncate and round numbers using integer division.
- 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:
compound assignment operators (/=, +=, -=, *=, %=)
increment/decrement (y++, ++y, y--, --y)
Correctly use the order of operation for arithmetic.
division, multiplication, modulus
Homefun read Sections 6.6 to 6.10; Exercises 8, 10, 11 p.166-167
Programming Assignment Lab 6.8, 6.9 p. 156-163, exercises 12, 13 p.167
|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.)
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.|
|Essential Question: Do we live in a binary world?|
Correctly use both if and if-else statements. (Be as one with the four Common if-else Errors on p. 189.)
Draw flowcharts for both if and if-else statements.
Correctly use boolean relational operators (p. 179, 181). == , > , < , >= , <= , !=
Correctly use boolean logical operators (p. 179, 181). && , || , !
Given a set of logic gates write the associated boolean expression (p. 3).
Write truth tables for "and", "or", and "xor" gates.
Evaluate complex boolean statements using correct order of operators (p. 184).
Correctly describe and use short-circuit evaluation (p. 184).
Correctly use if-else-if tables for menus and selection processes like tax tables. (p. 187)
Correctly use switch statements. (Be as one with the six points on p. 197)
Homefun read Sections ; Exercises 1-7 p.205-206
Programming Assignments: Lab 7.10 p. 190-195; Lab 7.12, p.198-202; exercises 14, 17 p.207
Tax Code Program II: rewrite the tax program entirely with if-else-if tables
Methods Constructers and Fields
Be as one with the nature of methods.
contain a small highly focused program or algorithm.
modular and reusable
defined in a class
static (called by a class name) or instance (called by an instance)
Correctly write the header which defines a method inside a class.
access (public or private) returnType methodName (type argName1, ... type argNameN)
Explain the nature of arguments.
creates a local variable inside the method
used for passing values into the method
when using objects can also pass a value out of the method
Correctly use overloaded methods. (Same name different arguments)
different numbers or types of arguments
return type must be the same.
Correctly use constructers.
name is identical to the class name
no return type, not even void
can be overloaded
Correctly use copy constructors.
State when the default constructer runs and how it initializes fields.
numbers = 0
booleans = false
references = null
Correctly use the "final" reserved word.
Correctly initialize objects and use the new operator (p. 224).
Homefun: read Sections 8.1 - 8.5; Exercises 1-6 p. 248 - 249
State which type of fields can be accessed and what type methods can be called using a static method. (p. 223).
can access static field - only one value & one memory address
can call static method
can access instance field of a different class
can call instance method of a different class
State which type of fields can be accessed and what type methods can be called using an instance method (p. 223).
instance field - Many values & memory addresses. A field has one value per object
static field - Only one value & memory address
Correctly call both static and instance methods (p. 226).
Use class name & dot operator when calling static methods from another class.
Use object & dot operator when calling instance methods from another class.
Class name & dot operator are optional when calling static methods in a class.
Use "this" & dot operator or nothing when calling instance methods in a class.
Compare the two ways to pass arguments to methods and constructers (p. 230).
Primitive data types are always passed as values
Objects are always passed as references.
Correctly use return statements.
Correctly use the access keywords public and private.
Exercise 18 will be on the next test