CMPT 125

04/10/13

Home
CMPT 125
CMPT 110
CMPT 210
CMPT 260
Information
Photo Gallery

 

Welcome to Programming!

bulletSyllabus      
bulletAssignment Lab Sheet
bullet

Code Examples

horizontal rule

 Important dates:

 January 21st - No Class  

 February 18th - No Class

 March 11th - 15th - Spring Break

 April 15th Patriots Day - No Class
  Last Class May 8th

 
 

horizontal rule

Reading Assignments

bullet

Lesson 1 - Introduction

bullet

 Objectives:
1.  Getting started
2.  Meet the creator of Alice, Randy Pausch
3. Learning how to zip files.

bullet

Lab1


bullet

Lesson 2 - Alice

bulletObjectives:

Installing Alice - At home
Using Objects
Using Methods
Changing Parameters

1.      View A Alice Demonstration from the Alice site All About Alice.

2.      View the Tutorials in Alice.

3.   Read Alice Chapter 1

Lab 2

 

bullet

Lesson 3 -  Java

bullet

Objectives:

          The JDK (Java Development Kit), TextPad Environment, Creating an Application, Creating an Applet
bullet

Downloads: SDK, TextPad

bullet

Or Download direct from: http://java.sun.com/javase/downloads/?intcmp=1281 JDK 6 Update 11, http://www.textpad.com/

  1. Read the first 3 pages http://java.sun.com/docs/books/tutorial/getStarted/intro/definition.html
  2. Read Moving to Java

    Lab 3

 

bullet

Lesson 4 - Using Data in a TextArea

bullet

Objective:

• New package java.io
• Declare and Constructing variables
• Math methods and operations Math.pow(), Math.round() “/” division and “+” plus
• BufferedReader, InputStreamReader
• parseInt(), ReadLine()

  1. Read this document Java Chapter 2

  2. Complete Lab 4 below

 

bullet

Task 1  -  2/16/2011
What you should know: Have Lab 4 done to study for this task. This task is very similar to Lab 4
• Creating an Applet
• Declare and Constructing variables
• Math methods and operations Math.pow(), Math.round() “/” division and “+” plus for concatenation
• BufferedReader, InputStreamReader
• parseInt(), ReadLine()

 

bullet

Lesson 5 - If Else and Using Operators

bullet

Objectives:

• if statements
• if else statement
• Comparison Operators
• Boolean Values
• Debugging

1.  Read this document If Else Statements
2.  Read the tutorial Lesson 8 from http://javalessons.com
3.  Complete Lab 5 below

       Practice for Task 2

Complete the the action event to perform the math operations in MathJavaTask2.java



bullet

Task 2 - 3/6/2013  Task 2 Directions

What you should know
bullet

Creating applets

bullet

If statements

bullet

If else statements

bullet

Comparison Operators

bullet

Boolean Values

bullet

Declare and Constructing variables

bullet

Math methods and operations, Math.round() “/” division and “+” plus
 

 

bullet

Lesson 6 - Loops and Swing Components

   Objectives

       • Loops
       • While Loops
       • For Loops
       • Swing Components

  1. Read this document Loops

  2. View this tutorial http://java.sun.com/docs/books/tutorial/ui/features/components.html

  3. Complete Lab 6 below
         

bullet

Lesson 7 -  Layout Managers

  Objectives

       • FlowLayout
       • BorderLayout
       • GridLayout

  1. Read this document Layout Managers

  2. View this tutorial at java lessons for more examples

  3. Complete Lab 7 below

 

bullet

Lesson 8- Arrays, Button Arrays, Menu Systems, System Clipboard

Objectives

       • Private Variables
       • Menu System
       • Arrays
       • Button Array
       • Access methods from Toolkit class

  1. Read this document Arrays

  2. View this tutorial at java lessons for more examples

  3. Complete Lab 8 below

 

bullet

Practice-Task 3 - Layout Mangers, Button Arrays, Menu System - Due April 17th - Counts as a Lab Grade

Create a Tic Tac Toe game layout based on the same layout concept of the Calculator application.  I know there are many working examples with source code on on the Internet.  Please by all means look at them borrow a few ideas but PLEASE make sure your code is your own.  Create your Tic Tac Toe layout with the following:

  1. This is only the layout and the functionality will be added in Task 4.
  2. Create the game as an Application for two players.
  3. Using a Button Array create a 3 x 3 grid layout using a Border layout that will display the SOUTH bound as a text field to display who won.
  4. Create a Menu system with File...Clear...Exit, About...About this game.
  5. Comment your code.
  6. Have fun with it!  Add any crazy backgrounds or sounds you like.
  7. Please get this task done by the dead line.

 

bulletPractice-Task 4 - Functionality of the Tic Tac Toe Appliction - Due May 24th- Counts as a Lab Grade

Create the functionality for the Tic Tac Toe layout that you have created in Task 3 with the following:

  1. When you click on a button an image will display. X or O or any other image you like.  Can be cats and dogs or what ever you like.
  2. Make the game for two players.
  3. Out put the winner in the text field in the SOUTH region.
  4. Add functionality to the menu system.  File...Clear...Exit  About...About your Game.

 

bullet

Task 3 -  Layout of a numbers hi - low game - Due May 1st

Create a Hi Low game using the following example as a guide.

Hi Low Layout

  1. This is only the layout and the functionality will be added in Task 4.
  2. Create the game as an Applet for one players.
  3. Using a Border layout to display directions in the  SOUTH and NORTH bound.
  4. A Textfeild to input your number.
  5. Comment your code.
  6. Have fun with it!  Add any crazy backgrounds or sounds you like.
  7. Please get this task done or not by the dead line.

Task Sheet

 

bulletTask 4 - Functionality of the Hi Low Applet - Due May 8th

Create the functionality for the HI Low layout that you have created in Task 3 with the following:

  1. When you enter a number a label will display if your guess in hi or low.
  2. Out put how many guesses it took when the correct number is entered.

Hi Low Example

Task Sheet

 

horizontal rule

Lab Assignments

Labs are to be done in class on Mondays.  You must have me sign your Lab Assignment sheet.  Print off a copy of the Lab Assignment sheet above.  Please keep your lab sheet up to date.  The lab sheet will be collected and graded in the last few weeks of the semester.

bullet

Lab 1 - Introduction

 Go To the link below and view the Last Lecture given by Randy Pausch.  It is about an hour long.

1. http://www.youtube.com/watch?v=ji5_MqicxSo

2. Write a summary of what the last lecture was about. Note:  Randy died about 2 years ago.

3. Zip your summery file with your name and save for your copy.

4.  Print and pass in a copy.

 

bullet

Lab 2 - Alice

1.           1. Create a world in Alice where a penguin walks across the ice and dives into a hole.

 

2.           2. Create a world using the vehicle gallery where multiple planes are flying through the sky at multiple speeds.

 

3.           3. Create a world of your choice.  Be creative and try out as many of Alice’s feature as you can.

 

bullet

Lab 3 - Java

bulletInstalling Java SDK & TextPad - On your Home Computer - CEC 04 has everything you need on the computers.

1.         1.  Create the HelloWorld  application.

2.         2.  Create the Welcome application

3.         3.  Create the WelcomeDate application

4.         4.  Create the WelcomeApplet

bulletLab 4 - Using Data in a TextArea

1. Create the Body Mass Index application.
2. Create the Body Mass Index applet and create the HTML file to call the class file.

bulletLab 5 - If Else Statements and Comparisons

1. Recreate the number swap applet on pages 1 and 2.
2. Convert the above code to an applet that will take in a text field to input the grade. Please use all labels to describe input and output fields. You may use an image of your choice. Be creative!

        Debugging
         1. Find the Four common errors in DebugFour.java application

 

bulletLab 6 - Loops and Swing Components
  1.  Recreate the 4 programs in this document.

a.      EverySum

b.      Input123

c.       Repaint

d.      Whileloop

bullet

Lab 7 - Layout Managers

1.       Recreate the FlowLayout application.

2.      Recreate the BorderLayout application

3.      Recreate the GridLayout applet

4.      Experiment with any of the layouts by adding your own features.  One example would be to add an action listener to the buttons in the GridLayout and have them add color or text to the textboxes.

 

bulletLab 8 - Arrays, Button Arrays, Menu System

1.      1.   Recreate ArrayExamples.

2.      2.  Recreate the Calculator application.

3.      3.  Extra credit will be given for the following:

a.      Changing the colors of the buttons

b.      Changing the general layout.

c.       Any code implemented that works that we haven’t used yet.

Task 1  -  TBA
What you should know: Have Lab 4 done to study for this task. This task is very similar to Lab 4
• Creating an Applet
• Declare and Constructing variables
• Math methods and operations Math.pow(), Math.round() “/” division and “+” plus for concatenation
• BufferedReader, InputStreamReader
• parseInt(), ReadLine()

 

Task 2  -  TBA
What you should know: Have Lab 5 done to study for this task.
• Creating an Applet
• Declare and Constructing variables
• Basic Math methods and operations , Math.round() “/” division and “+” plus for concatenation "*" multiplication 
• BufferedReader, InputStreamReader
• parseInt(), ReadLine()
• If Else statements

 

Task 3  -  TBA
What you should know: Have Lab 8 done to study for this task.
• Button Arrays
• Layout Mangers
• Menu Systems 
• Basic swing components
• For loops
• If Else statements

 

Task 4  -  TBA
What you should know: Have Lab 8 done to study for this task.
• Button Arrays
• Layout Mangers
• Menu Systems 
• Basic swing components
• For loops
• If Else statements

Java Task 2

 

 

 

 

 

 

 

 

Home | CMPT 125 | CMPT 110 | CMPT 210 | CMPT 260 | Information | Photo Gallery

This site was last updated 04/10/13