Difference between revisions of "Telgar/Problem311"
From Exalted - Unofficial Wiki
m |
m (link fix) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | public class Collection | |
− | |||
− | public class | ||
{ | { | ||
− | + | public Collection() | |
− | |||
− | |||
− | |||
− | |||
− | public | ||
{ | { | ||
+ | [[ArrayList]] CDC = new [[ArrayList]](); | ||
} | } | ||
− | + | public void addCD() | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{ | { | ||
− | System.out. | + | int ye; |
− | + | int id; | |
− | + | String ti; | |
+ | String ar; | ||
+ | String ge; | ||
+ | |||
+ | System.out.println ("Enter year of purchase"); | ||
+ | ye = Keyboard.readInt(); | ||
+ | System.out.println ("Enter title of CD"); | ||
+ | ti = Keyboard.readString(); | ||
+ | System.out.println ("Enter arist"); | ||
+ | ar = Keyboard.readString(); | ||
+ | System.out.println ("Enter genre"); | ||
+ | ge = Keyboard.readString(); | ||
+ | System.out.println ("Enter ID number"); | ||
+ | id = Keyboard.readInt(); | ||
+ | Collection.addCD(); | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } |
Latest revision as of 01:18, 6 April 2010
public class Collection {
public Collection() { ArrayList CDC = new ArrayList(); } public void addCD() { int ye; int id; String ti; String ar; String ge; System.out.println ("Enter year of purchase"); ye = Keyboard.readInt(); System.out.println ("Enter title of CD"); ti = Keyboard.readString(); System.out.println ("Enter arist"); ar = Keyboard.readString(); System.out.println ("Enter genre"); ge = Keyboard.readString(); System.out.println ("Enter ID number"); id = Keyboard.readInt(); Collection.addCD(); }
}