P2 - CSE 17 Programming Assignment Assignment 2 Due at...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 17 Programming Assignment Assignment: 2 Due: 10/24/2012 at 11:00 PM Late Collections: 10/25/2012 at 11:00 PM 10/26/2012 at 11:00 PM Folder Name: P2 Program Name: P2.java Account.java AccountDatabase.java Modify class Account by adding the following methods: toString() method where the output of an account should print as specified below: Balance for Account 12345 is 300.0 with an annual interest rate of 4.5 Add a one-arg value returning public method called compareTo. The one parameter passed to compareTo is an Account object. CompareTo should compare the account id’s from both objects and return a negative value if the calling object is numerically less than the parameter account object’s account id. Design a class called AccountDatabase that will represent the storage structure for Account Data. The class contains: Four instance variables A Scanner object named inputStream that represents the input file used to read Account data into the database. A PrintWriter object named outputSream that represents the output files used to print the Account data to a text file or to print. An array of Account named data . An integer field named numAccts that represents the number of Accounts stored in the data array . Keep in mind, your array called data will be sized larger than
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

P2 - CSE 17 Programming Assignment Assignment 2 Due at...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online