Description: UNCW Home

Description: UNCW HomeDescription: Breaking News! Click here for details.

 CSC 121 - Introduction to Computer Science I 

 

Syllabus    /    Glossary    /    CodeLab    /    Algoritharium

Week
Starting

Schedule of Activities and Assignments (DRAFT 11-21-2011)

Monday, 22 August 2011

Note: The first day of classes is Thursday, 25 August 2011

  1. In class - Your First Program (click the In class link to get the pdf lecture for each day) Reading: pp 4-12
    Highlights:  1.1.1 p.6  Hello World
    OS X / Linux / Windows
    % javac HelloWorld.java
    % java  HelloWorld

    where % represents the command line prompt in the current directory

Objectives:

    1. Using text editor
    2. verify installation of JDK
    3. competency with javac and java commands
    4. work with command line arguments
    5. introduce array notation
    6. Java Syntactical Structure
    7. HelloWorld vocabulary - click on each vocabulary word

 

2.       In class - Built-in Types of Data  (basic definitions / trace / text / integers) Reading: pp 14-22, 35
Highlights: 1.2.3 p.20 Quadratic formula 
                1.2.4 p.27 LeapYear              

Objectives:

    1. Identifiers,
         Literals, and
         Variables p. 15
    2. Statements:
         declarations,
         assignments, and
         initialization p. 17
    3. Tracing changes in variable values p. 17
    4. data types:
         String,
         int pp 19, 21
    5. source files, class files
    6. BuiltInTypes vocabulary -be sure to click on each vocabulary word

 

Monday, 29 August 2011

Tuesday, 30 August 2011

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-37

Thursday, 1 September 2011

  1. Reading: pp 22-38
    In class - Built-in Data Types
    (floating-point numbers / Math Library / Booleans / Comparisons):

Objectives:

    1. Boolean, numeric types (double, long) pp 25, 32
    2. Comparisons - Booleans and Comparisons
    3. Math class methods, API, p. 29
    4. Anatomy of a method signature p. 30
    5. Type conversion pp 31, 32
    6. BuiltInTypesII vocabulary

Monday,
5 September 2011

Tuesday, 6 September 2011

Guided Exercise - Lab 2  (do all of the lab exercises) 

Codelab: Complete section 1.2 Built-in Data Types subsections Floating Point (10) and Boolean (23) problems
   Floating Point -
Literals 20539-40
   Floating Point -
Declarations 20541-43
   Floating Point -
Operations 20544-48
   Boolean -
Literals 20549-50
   Boolean -
Declarations 20551
   Boolean -
Relational Operators 20608, 20552-60
   Boolean -
Logic Operators 20561-65, 20610-11
   Boolean -
Boolean Variables 20609, 20612-13

  1. In class - Conditionals and Loops (control flow / conditionals / while loop / for loop / nesting): Reading: pp 47-57, 74 conditionals and loops, 1.3.1  p 49 Flipping a fair coin, 1.3.2 p. 51 Your first while loop, then extend 1.3.1 to count number of times heads/tails come up in a loop, extend to count outcomes for rolls of a six sided die with a variable for each outcome. Accumulating a sum p. 57 examples (all), nested loops, 1.3.7 p 64 Converting to binary, 1.3.9 Factoring Integers, FairDie.java 

Objectives:

    1. flow of control
    2. while loops
    3. for loops
    4. conditional operator:  int min = (x < y) ? a : b;
    5. algorithms
    6. looping examples
    7. debugging
    8. Conditionals and Loops vocabulary

 

Program 1 Assigned: (on your own program assignment due 20th September)

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:

    1. compute maximum and minimum values of the function on [a, b].
    2. compute scaling factor sf. For example, does the following accomplish all we need?
      sf = graphPageWidth/(max - min).
    3. construct for each point in the interval the required number of spaces (one for each column) preceding the plot (an *)
      #cols = sf ( f(a +idx) - min ).

Points breakdown

      • 0 - doesn't compile
      • 20 - Input and output a, b, & n
      • 40 - Calculate and print dx
      • 60 - Find and print the max & min on [a, b]
      • 80 - Find and print the scale factor
      • 100 - Plot the function x3 on [a,b] in one program and
                   1 - x2
        on [-1, 1] in another. You will be required to demonstrate your program using a test function provided in class on the date delivery is due.
                    Sample output: a, b, c, d.

 

Thursday, 8 September 2011

Program 1 discussion continued. Work on designing a plan for coding. Guided Exercise - Program 1 guidance

Guided Exercise - Lab 3  (do all of the lab exercises   -MAC users tips for working with the algoritharium) 

Quiz 1 in class.

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 one 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 Assignment 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

 

Monday,
12 Sep 2011

Tuesday, 13 September 2011

  1. In class - Arrays ( array processing code / setting array values at compile time)Reading: pp 58-76  FairDie.java variables in context of args[] develop an array f. Using this transformation, 
    1. We can have as many faces as desired using a runtime argument
    2. The code is much quicker to implement
    3. Shorter code is easier to debug
    4. Recall tmp = (int)(Math.random()*6 + 1)

§  How can this be adapted to n faces?

      • How can tmp be used to count the outcomes?  

Arrays

  1. In class - Arrays (multidimensional arrays / setting 2D array values at compile time / array addition / array multiplication / memory representation)Reading: pp 88-91 Array processing

Objectives:

    1. arrays
    2. zero-based indexing
    3. array length
    4. memory representation
    5. bounds checking
    6. setting array values (initialization) at compile time
    7. setting array values at run time

Thursday, 15 September 2011

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

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

Monday,
19 Sep 2011

Tuesday, 20 September 2011

Program 1 due (plan to demonstrate in class)

  1. In class - Arrays (multidimensional arrays / setting 2D array values at compile time / array addition / array multiplication / memory representation)Reading: pp 92-101 continue with Array processing

Objectives:

a.    arrays

b.    zero-based indexing

c.     array length

d.    memory representation

e.     bounds checking

f.     setting array values (initialization) at compile time

g.     setting array values at run time

Guided Exercise - Lab 4  (do all of the lab exercises) 

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

Thursday, 22 2011

Quiz 2 in class

 

Monday,
26 Sep 2011

Tuesday, 27 September 2011

  1. Reading: pp 102-112
    In class - Arrays: Multidimensional Arrays, Flow of Control, Flow charts, Array processing

Objectives:

    1. Matrix addition
    2. Matrix multiplication
    3. Primitive datatypes review
    4. looping examples review
    5. typical array processing code review

Guided Exercise - Lab 5  (do all of the lab exercises) 

Codelab: Complete section 1.5 Input and Output (5 problems)
   Input and Output 20507-9, 20606, 20743

Program 2 Assigned: due October 20th: 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)

1.       25 pts: red/green/blue horizontal stripes

2.       50 pts: red/green/blue vertical stripes

3.       70 pts: checkerBoard

4.       80 pts: cross

5.       90 pts: inset

6.       100 pts: quad

7.       110 pts: An interesting flag of your own design (must have all 100 pts to be eligible for bonus points.)

Thursday, 29 September 2011

Quiz 3 in class

 

Monday,
3 October 2011

Tuesday, 4 October 2011

Thursday, 6 October 2011

In-class interim TEST 1, includes writing, coding, and demonstrating a program.

Monday,
10 October 2011

Monday and Tuesday, 10-11 October 2011, Fall Break, No Classes

Thursday, 13 October 2011: Last day for undergraduates to withdraw with a “W”

In class - Input and OutputReading: pp 120-136, 152 Algoritharium Basic Image Filter Design.
Screen cast -User input via the keyboard, working with double arrays in the Algoritharium

In-class - Static Methods (function / scope / flow of control / Gaussian distribution / overloading / multiple arguments): Reading: pp 183-198 Chapter 2 Functions. 
Guided Exercise - Lab 6  (do all of the lab exercises) 

Codelab: Section 2.1 Static Methods (10 problems)
   Static Methods - Method Definitions 20651-8
   Static Methods -
Arrays and Methods 20650, 20659

Monday,
17 October 2011

Tuesday, 18 October 2011

  1.  In class - Static Methods (function / scope / flow of control / Gaussian distribution / overloading / multiple arguments): Reading: pp 199-208 Chapter 2 Functions continued

Objectives:

    1. Static methods vocabulary

Codelab: Complete section 2.1 Static Methods (15 problems)
   Static Methods - More Examples 20660-4
   Static Methods - Methods with Strings 20840-6
   Static Methods - Finding Extremes 20717-9

Thursday, 20 October 2011--No Class—Work on your Program 2 demonstration, which is due 27 October 2011 in class.

 

Monday,
24 October 2011

Tuesday, 25 October 2011

In class lab day. Practice creating and using methods.

Thursday, 27 October 2011

Program 2 due (plan to demonstrate in class)

TotalBeginnerCompanionGuide (lessons 1-3 only) / lesson01 / lesson02 / lesson03 / debugger-lesson01 / lesson02 / lesson03 / archive.zip
This is a nice approach to working with objects using Eclipse. The TotalBeginner series is rather long, but you may find the first three lessons helpful as we approach the biggest hurdle for programming in Java -defining our own data types. The TotalBeginner series is optional.

 

 

Monday,
31 October 2011

Tuesday, 1 November 2011

  1. Chapter 3 section 3.1 Data Types
    In class - Data Types
    (objects / constructors and methods / Color data type / String data type / text processing)Reading: pp 315-361, 359

Guided Exercise - Lab 7  (do all of the lab exercises) 

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
 

Thursday, 3 November 2011

In class lab day.

 

Monday,
7 November 2011

Tuesday, 8 November 2011

Chapter 3 section 3.2 Creating Data Types
In class - Creating Data Types
(defining data types / a simple client / anatomy of instance variables / anatomy of a constructor / anatomy of a data type method / anatomy of a class / Complex numbers / Mandelbrot set): Reading: pp 370-390  
A complex number is a number of the form x + iy, where x and y are real numbers and i is the square root of -1. The number x is the real part and y is the imaginary part. Developing this datatype is a prototypical example of object-oriented programming.

Codelab: Complete section 3.1 Data Types (16 problems)
   Data Types - Creating Objects 20585-90, 20764, 20771, 20782
   Data Types -
Invoking Object Methods 20578-84

Thursday, 10 November 2011

Chapter 3 section 3.2 Creating Data Types (continued)
In class - Creating Data Types (defining data types / a simple client / anatomy of instance variables / anatomy of a constructor / anatomy of a data type method / anatomy of a class / Complex numbers / Mandelbrot set): Reading: pp 391-405   Some useful classes:

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 ()

Monday,
14 November 2011

Tuesday, 15 November 2011

Program 3 Assigned: PolyGrapher

Guided Exercise - Lab 8  (do all of the lab exercises)

Codelab: Section 3.2 Creating Data Types (7 problems)
   Creating Data Types -
Static members 20638-42
   Creating Data Types -
Minimal 20626-7

Thursday, 17 November 2011

In class Lab

Monday,
21 November 2011

Tuesday, 22 November 2011

Chapter 3 section 3.3 Designing Data Types
In class - Designing Data Types
(encapsulation / immutability /final access modifier): Reading: pp 416-426 

Mandelbrot Set  Plot (x, y) black if z = x + y i is in the set, and white otherwise.      Jonathan Coulton + Mandelbrot Set

Description: mandelbrot

 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: Complete Section 3.2 Creating Data Types (9 problems)
   Creating Data Types - Instance Variables 20628-32
   Creating Data Types - Constructors 20633-7
 

Chapter 3 section 3.3 Designing Data Types last day to withdraw with a w
In class - Designing Data Types
(encapsulation / immutability /final access modifier): Reading: pp 427-449 

Guided Exercise - Lab 9  (do all of the lab exercises)

Codelab: Section Class Definition Practice  (15 problems)
   Class Definition Practice -
GetSet-- Go! 20744-7
   Class Definition Practice -
Counter 20725-29
   Class Definition Practice -
Accumulator 20730-35

Wednesday-Friday, 23-25 November 2011—Thanksgiving Holiday—No Classes

Monday,
28 November 2011

Tuesday, 29 November 2011

Program 3 due (plan to demonstrate in class)
Program 4 Assigned: Name That Shape

Quiz 4 in class

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

Through Interim II Java Language keywords     
 
Guided Exercise - Lab 10  (do all of the lab exercises)

Thursday, 1 December 2011

Second Interim Exam -   All assignments due prior to the interim must be completed and graded before the interim.

DRAFT updated with CodeLab assignments to here (11-21-2011)

Monday,
5 December 2011

Tuesday, 6 December 2011

·         Review

·         Program 4 due (plan to demonstrate in class)

·         SPOT forms

·         Complete all outstanding Codelab assignments. After 11:59 pm tonight no more will be accepted.
Note that a few sections of Codelab are available as "extras" and are not graded. These are Interlude: Some Techniques (9), Interlude: Invoking Methods (17), and Extras (30).
Codelab solutions become available Reading Day.

Last Class Meeting Day for CSC 121-001: Tuesday, 6 December 2011

Last day of classes for the semester: Wednesday, 7 December 2011

Reading Day: Thursday, 8 December 2011

Monday,
12 December 2011

Final Examination: Tuesday, 13 December 2011, 8:00-11:00 AM, in CIS 2006

·         Comprehensive, timed, in-class programming exercise

·         Check here for additional instructions