|
|
|
| CSC 121 - Introduction to Computer Science I |
|
|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| P1 | P2 | T1 | |
P3 | P4 | T2 | ||||||||||||||||
Guided Exercise - Lab 1
(do all of the lab exercises)
Codelab: (graded drill and practice with
feedback) Complete section 1.1 Your
First Program All five problems.
Codelab:
(graded drill and practice with feedback) Complete section 1.2 Built-in
Data Types subsection Integers (19)
problems
Integers - Literals 20519-21
Integers - Constants 20522-23
Integers - Declarations
20524-28
Integers - Operations 20529-35
Integers - Precedence 20536-7
Guided Exercise - Lab 2
(do all of the lab exercises)
Quiz 1 May 21-22 in Blackboard -be sure to log in to your account prior to class: User ID is your UNCW email without the @uncw.edu, password is your six digit SeaNet password... under Assessments. Note, no makeups- the quiz is a milstone for establishing your progress.
Codelab:
Complete section 1.2 Built-in
Data Types subsections Floating Point
(10) and Boolean (22) problems
Floating Point - Literals
20539-40
Floating Point - Declarations
20541-43
Floating Point - Operations
20544-48
Boolean - Literals 20549
Boolean - Declarations 20551
Boolean - Relational Operators
20608, 20552-60
Boolean - Logic Operators
20561-5, 20610-11
Boolean - Boolean Variables
20609, 20612-13
Guided Exercise - Lab 3
(do all of the lab exercises -MAC
users tips for working with the algoritharium)
Want to program in java with Eclipse on another
computer? Consider running Eclipse/Java off of your jump drive: Place
the Eclipse folder and the JDK folder (from your Program Files/Java/
directory) on your jump drive then modify the eclipse.ini file in the
Eclipse folder on your jump drive by adding two lines before the -vmargs
option. First the -vm to specify the JVM
to use and that the path to the jdk follows, then on a separate line
the full path to javaw.exe. http://wiki.eclipse.org/Eclipse.ini
Here is one example with my particular version of jdk.
Yours will be different:
-vm
E:\jdk1.6.0\bin\javaw.exe
Codelab:
Complete section 1.2 Built-in
Data Types subsections Character Type, Conversions
and Casting, Assignment, and Review (23
problems)
Character Type - Literals
20566-70
Character Type - Declarations
20571
Conversions and Casting 20758,
20572
Assignment - Simple 20591-2
Assignment - Compound 20593-97
Assignment - Boolean Assignmnet
20756
Assignment - String Variables
20757 -look up swap -variable values in the index but instead of
working with int t and int a and b work with String t, and s1 and s2.
Assignment - 4 Variable Rotate
20769
Review 20510-14
Program 1 Assigned: (on your own program assignment due Tuesday, May 29th) Create a simple plotter (x-axis runs vertically, y -axis runs horizontally) using command line arguments for a (left end point), b (right end point), and n (number of sub-intervals of [a, b].) Plot.pdf Steps:
Codelab: 1.3 Conditionals
and Loops (24 problems)
Conditionals - Statements - Simple if
20614-7
Conditionals - Statements - Simple if-else
20618-20
Conditionals - Statements - Cascaded
20621-2
Conditionals - Expressions
20624-5, 20768
Loops - for 20689, 20674-7,
20686-8
(screen cast -for
loop demo)
Loops - while 20678-81
Quiz 2 May 24-25 in Blackboard
Codelab:
Complete section 1.4 Arrays
subsections Assignment, Declaration, and
Initialization (17 problems)
Arrays - Assignment
20699-709
Arrays - Declaration 20690-1
Arrays - Initialization
20692-4, 20759
Guided Exercise - Lab 4 (do all of the lab exercises)
Guided Exercise - Program 1 guidance
Codelab:
Complete section 1.4 Arrays
(10 problems)
Arrays - Access
20695-8
Arrays - Array Sum Snippet 20792
Arrays - Array Average 20710
Arrays - String Array Traversal Snippet
20765
Arrays - Array Reversal 20711-2
Arrays - Counting Array Elements 20716
Guided
Exercise - Lab 5
(do all of the lab exercises)
Quiz 3 May 29-30 in Blackboard
Codelab:
Complete section 1.5 Input
and Output (5 problems)
Input and Output
20507-9, 20606, 20743
Program
2 Assigned due Monday, June 4th:
Flags Project: Create a java
class named Flags with six/seven
methods, each of which creates one of the following flags. (Guidance
from a student)
Codelab:
Section 2.1
Static Methods (10 problems)
Static Methods - Method
Definitions 20651-8
Static Methods - Arrays and Methods
20650, 20659
Strings.
We've been using strings and string concatenation since our very first Java program. Now we will explore many additional operations built in to Java's String data type that open up the world of text processing. Before using them, we must know their calling conventions. The Application Programming Interface (API) describes the set of operations associated with a data type and how to invoke them. You can find formal descriptions in Sun's online documentation of the String class. The table below summarizes several useful string processing methods and gives brief examples to illustrate their usage. As with arrays, the characters of a string are indexed starting at 0.
| Operation | Description | Invoking string s | Return value |
|---|---|---|---|
| s.length() | return length of s | Hello | 5 |
| s.charAt(1) | return character of s with index 1 | Hello | e |
| s.substring(1, 4) | return substring from 1 (inclusive) to 4 (exclusive) | Hello | ell |
| s.substring(1) | return substring starting at index 1 | Hello | ello |
| s.toUpperCase() | return upper case version of s | Hello | HELLO |
| s.toLowerCase() | return lower case version of s | Hello | hello |
| s.startsWith("http:") | does s start with http:? | http://www.cnn.com | true |
| s.endsWith(".com") | does s end with .com? | http://www.cnn.com | true |
| s.indexOf(".java") | return index of first occurrence of .java in s (-1 if no occurrence) | Hello.java.html | 5 |
| s.indexOf(".java", 6) | return index of first occurrence of .java in s, starting at index 6 | Hello.java.html | -1 |
| s.lastIndexOf(".") | return index of last occurrence of . in s | Hello.java.html | 10 |
| s.trim() | return s with leading and trailing whitespace removed | " Hello there " | "Hello there" |
| s.replace(",", ".") | return s with all occurrences of , replace by . | 13,125,555 | 13.125.555 |
| s.compareTo("abc") | compare s to abc lexicographically | "abc" | 0 |
Program 2 due (upload your zipped project folder to Blackboard)
Guided
Exercise -
Lab 7
(do all of the lab exercises)
Codelab: Complete section 2.1 Static
Methods (14 problems)
Static Methods - More
Examples 20660-4
Static Methods - Methods with Strings
20840-5
Static Methods - Finding Extremes
20717-9
Debug Quiz June 6-7
Codelab:
Complete section 3.1 Data
Types (15 problems)
Strings - Comparison
20598-601
Strings - Concatenation
20847-8, 20810
Conditionals - Expressions
20624-5, 20768, 20787
Conditionals - MaxMin
20602-5
Data Types - Reference Types
20516-18
| Class: | Point ScreenCast | Fraction | Quadratic ScreenCast |
| private instance variables |
int
x, int y |
int
num, int denom |
double[]
coef, int n |
| constructor(s) | public Point (int x, int y) | public Fraction (int n, int d) | public Quadratic (double a, double b, double c) |
| public methods |
public
String toString () public double distance (Point b) |
public
String toString () public Fraction add (Fraction b) public Fraction sub (Fraction c) public Fraction simplify () public Fraction inverse () public Fraction multiply (Fraction b) |
public
String toString () public double evaluate (double x) public double[] getQuadRoots () |
|
Mandelbrot Set Plot (x, y) black if z = x + y i is in the set, and white otherwise. Jonathan Coulton + Mandelbrot Set |
|
|
|
No simple formula describes which complex numbers are in the set.
Instead, describe using an algorithm:
Iterate
zt
+
1 = (zt
)2
+
z0.
If
|
zt
| diverges
to infinity, then z0 not in
set;
otherwise z0 is in set. An interesting part of Mandelbrot set between (-1.5, -1) and (0.5, 1). Fractal is a geometric shape that can be divided into parts, each of which is (approximately) a reduced size copy. Can model complex rugged shapes algebraically (unevenness of clouds, contours of mountains, winding riverbeds). Also useful for image compression and art. |
Codelab: Section 3.2 Creating Data
Types (7 problems)
Creating Data Types - Static
members 20638-42
Creating Data Types - Minimal
20626-7
Codelab:
Complete Section 3.2
Creating Data
Types (9 problems)
Creating Data Types - Instance Variables
20628-32
Creating Data Types - Constructors
20633-7
Guided Exercise - Lab 10 (do all of the lab exercises)
Codelab: Section Class Definition Practice
(10 problems)
Class Definition Practice - GetSet-- Go!
20744-7
Class Definition Practice - Counter
20725-29
Class Definition Practice - Accumulator
20730-35
Quiz 4 June 13-14 in Blackboard
Codelab: Section Class Definition Practice
(9 problems)
Class Definition Practice - Gas Tank
20736-8
Class Definition Practice - Book
20739-40
Class Definition Practice - ParkingMeter
20741-2
Class Definition Practice - Value
20772, 20760
Complete all outstanding CodeLab
assignments.
Note that a few sections of Codelab are available as "extras" and are
not graded, however any that you get right will improve your grade as
your CodeLab grade can be as much as 105% of 100. These are Interlude:
Some Techniques (9), Interlude: Invoking Methods (17), and Extras
(28).