CS 21a Introduction to Computing I Section E
1st Semester, 2010-2011
John Paul Vergara, Ph.D
Announcements
- No classes on Friday, October 8. I will be available
(in my office at Xavier Hall) for consultation
- Program defenses (for Projects 2 and 3)
will be on October 14 and 15. Signup sheets are posted
at the DISCS (F209).
- Our second handson exam will be on Wednesday, Septermber 8,
130-330pm (note the 2-hour schedule).
The exam will be on loops; review printing shapes and letters.
- To accomplish the console portion of your project,
use the following sample project
as a pattern.
- Files for Loops Lab:
-
The specs originally posted in moodle is for Project 2, due much later.
Take note of the following:
- Specs for the first project (due August 25) are now
available through this
moodle link .
- August 6: Homework for this weekend
Download this other version
of the Grocery project discussed in class.
This version is designed so that there is only
a single sell method for the Cashier class.
Refer to Grocery.java for details.
Create the corresponding Cashier class so that Grocery.java works.
When it executes,
the following output
should result.
Note that if there isn't enough stock for a sale,
only the remaining stock is sold
(and a message mentioning this exception is printed).
You do not need to submit this homework.
Just carry it out and be ready for questions on it on Monday.
- There will be NO CLASSES/LAB on Friday, August 6,
as our room will not be available during that date.
Keep posted on this website for an assignment you will need
to carry out to make up for that missed lab class
(do not worry, the task I will assign will be easy).
- Welcome to the CS 21a E section website. Visit this site regularly.
Section-specific announcements and material will be posted here.
Course Material
-
Object Examples (BlueJ Project)
-
BankAcccount class code development progression:
public interface ,
comments ,
complete class ,
documentation generated by java doc ,
tester .
- Lab 1b to be accomplished on July 9.
- July 12: While waiting for your instructor,
download this BlueJ Project ;
unzip and execute.
Try to understand why the output is as shown.
- Handson Exam on Decisions on Friday, July 30.
Here are sample handson exams given two years ago:
Bus objects
Knapsack objects
- Object Interaction Examples
(BlueJ Project)
- Grocery (BlueJ Project)
as discussed during our August 4 class.
- Exercises for Loops (use this to review for your next handson exam):
Shapes , Letters .
- Arrays: download this BlueJ Project ,
and study the different classes.
- Bank-BankAccount
BlueJ Project using arrays.
- Seatwork/Homework (not graded) given on Friday, August 27:
Implement a Dictionary class as an aggregate of WordRecord objects.
Dictionary should have addEntry and getDefinition methods,
while WordRecord stores a word and a definition (as Strings)
with corresponding getWord and getDefinition methods.
-
BlueJ Projects demonstrating inheritance:
Different accounts
version 1 and
version 2 .
Corresponding JCreator projects:
version 1 and
version 2 .
- BlueJ project
that you will start with for your second handson exam.
- September 13:
- Download the
JCreator version
of the Bank Accounts project demonstrating inheritance.
To execute, open the folder and double-click on the project file,
then click on the "Play" button.
Explore the different features of JCreator:
e.g., open the different classes in the project.
- For today, we will discuss this
Inheritance exercise .
Download and JCreator project and read the instructions
while waiting for your instructor.
- Sample Java GUI code
using applets and frames.
- Sample Java event programming code
using applets and frames.
- Sample Java code
demonstrating layout managers
- Sample GUI Lab/Handson
- Calculator Example demonstrating event-driven programming
Version 1:
uses multiple listener objects, one per button
Version 2:
uses a single listener object for many buttons
(through ActionEvent)
-
Creating JAR files