Assignment 2 – AK/ITEC 1630SU, Summer 2008

Due Date: July 7, 2008 (Monday), 11:59pm.
Files to Submit: : Car.java, NewCar.java, UsedCar.java,

CarDealerShip.java, Dealer.java, CarTool.java, CarToolFrame.java

Submission Instructions

Activate AML-Advanced/Arts Multimedia. You may do so via Manage My Services (formerly link: . As the aml account is activated, you should take down your user id and password, both of which will be needed for file submission. If you experience any problem, contact the helpdesk.

Use FTP to transfer the files to unix.aml.yorku.ca. Make sure that you use your own unix.aml.yorku.ca account. Otherwise, no grades will be assigned to you. For more information on FTP, go to FTP site

Download the submission.html file from the course web site for detailed instructions on how to submit the assignments.

Assignment Question

This assignment asks you to write a tool for a car dealership to use. The tool contains two parts. The first part is the model and the second part is the GUI. You have done the model in Assignment 1. Based on the model classes you have created in Assignment 1, you are requested to provide the GUI part in this assignment.

GUI

Write a Java Swing application that will allow users to do the following operations:

  1. Add new car
  2. Add used car
  3. Print a report of all cars

This GUI application will invoke the methods addNewCar, addUsedCar, and printReport of your CarDealerShip class. The main screen of your application should look like below

When the “Add New Car” button (JButton)is clicked, the texts entered in the text fields (JTextField) for model, year made, price, and color will be parsed and passed to the method addNewCar of class CarDealerShip. When the “Add Used Car” button is clicked, the values entered in the text fields for model, year made, price and check box rusty (JCheckBox) will be parsed and passed to the method addUsedCar of class CarDealerShip. When the “Print All Cars” button at the bottom is clicked, the method printReport of CarDealerShip will be invoked and its returned string will be displayed in the text area (JTextArea)above the “Print All Cars” button. The text area must be scrollable as shown below

You will provide the GUI part in two classes – CarTool and CarToolFrame. To make it a complete application, also submit the model classes that you have submitted in Assignment 1.

Marking Schemes:

  • Program running correctly earns 70%;
  • Proper GUI and Layout 20%;
  • Programming style: comments, redundant code etc. 10% ;
  • Late assignment will not be marked.