Home » Archive

Articles in the 2010 APCS++ Category

2010 APCS++ »

[23 Mar 2011 | 3 Comments | ]

D D C D A D D C C A D E D D E E E A D C

2010 APCS, 2010 APCS++, 2011 APCS, 2013 APCS »

[8 Mar 2011 | No Comment | ]

This quiz will primarily focus on Binary, Arrays, ArrayLists, & classes (Interfaces and GridWorld will only be on the Final).  There may be other material on there as well.  You should be very comfortable defining a simple class, answering questions about using a Class, Array & ArrayList Mystery/Simulations and building an ArrayList Program with a couple Binary conversions thrown in.
Here are some practice problems.  Also refer to the multiple choice practice set.
Oracle classes questions and exercises
Presentations on ArrayLists & Arrays too:
- ArrayLists
- Arrays, Part I
- Arrays as Parameters
- Arrays for Tallying
Arrays & ArrayList …

2010 APCS++ »

[14 Feb 2011 | No Comment | ]

You will work in pairs to practice object-oriented design while modeling an automatic teller machine that builds upon your existing BankAccount inheritance hierarchy.
You will turn in a brainstorming document that demonstrates your process for finding classes, determining classes’ responsibilities and finding the relationships between classes.  This should include a rough class diagram (doesn’t have to be formal UML).  You will then implement the ATM and a textual client to test it.
Each customer of a bank has a customer number, a PIN (personal identification number) and two accounts: a checking account …

2010 APCS++ »

[7 Feb 2011 | 2 Comments | ]

As always, many thanks to Stuart Reges for letting me mercilessly steal from his excellent materials!!
You will need two support files: ShoppingMain.java and ShoppingFrame.java.
This assignment will allow you to use ArrayLists and explore “has-a” relationships between classes (as opposed to “is-a” or inheritance).  It will hopefully also give you some insight on how larger, graphics-based programs are designed and built. Your task will be to write a set of supporting classes for a simple shopping program.  I’m providing the GUI code (Graphical User Interface) that will provide the “front end” …

2010 APCS++ »

[3 Feb 2011 | No Comment | ]

A bank offers two kinds of accounts: checking and savings.  Sound familiar?  You’ve modeled this in Scheme!
Checking accounts contain a customer’s name, current balance and a count of transactions (how many withdrawals and deposits). Savings accounts contain a customer’s name, current balance, and interest rate.
Both checking accounts and savings accounts can be treated as BankAccounts but BankAccounts can’t be instantiated.  All BankAccounts MUST define an isFDICInsured method that returns true or false.  BankAccounts know how to deposit, withdraw, transfer an amount to another account and print themselves.  Any transaction that …

2010 APCS++ »

[1 Feb 2011 | No Comment | ]

Before we move on to bigger, more real things, let’s take a moment to think about designed in a somewhat contrived context.  Build an inheritance hierarchy to model types of tickets to a school dance.  Each ticket has a unique number and a price.  There are three types of tickets: walk-up tickets, advance tickets, and student advance tickets.

Walk-up tickets are purchased the day of the event and cost $50
Advance tickets purchased 10 or more days before the event cost $30, and advance tickets purchased fewer than 10 days before the …

2010 APCS++ »

[31 Jan 2011 | 6 Comments | ]

Objects have failed
Objects have not failed
Have objects failed? Do you trust these guys’ opinions? Please share your thoughts!

2010 APCS++ »

[18 Jan 2011 | No Comment | ]

GridWorld is your AP case study. It’s a great opportunity to get familiar with a larger code base and see an example of well-designed object-oriented code at work. I hope you’ll have fun working with it, too!
Getting the files
Download a zip file of the Gridworld code.
Extract all the files from the Gridworld archive into your computer science folder.
Eclipse
1) Create a new project
2) Right click on the project name in the package explorer
3) Click on ‘properties’ (very bottom option)
4) Click on ‘Java Build Path’
5) Click on ‘Add External JARs’
6) …

2010 APCS++ »

[17 Jan 2011 | No Comment | ]

Hopefully this guide will be a useful reference to you as you write more and more complex classes.  This text is HEAVILY inspired by Cay Horstmann’s Big Java although I do things in a slightly different order.  Any errors or bad advice are my own.
As you follow this tutorial, write the code and make sure you understand it step by step.  We’ll go through creating a CashRegister class.  Objects created from this class should be able to do the following:

Ring up the sales price for a purchased item
Enter a payment …