CS 171: Introduction to Computer Science II
1/30/2012 1
CS 171: Introduction to Computer Science II Methods, OO, - - PowerPoint PPT Presentation
CS 171: Introduction to Computer Science II Methods, OO, Inheritance Li Xiong 1/30/2012 1 Announcement Eclipse/debugging lab 1/30, Monday, 5-6pm, E308 Hw1 To be assigned 1/31, Tuesday To be assigned 1/31, Tuesday Due
1/30/2012 1
1/30/2012 3
public static void main(String[] args) {
System.out.println("sum(1, 10) is: " + sum(1, 10) ); // 1+2+...+10 System.out.println("sum(25, 30) is: " + sum(25, 30) ); //25+26+...+30 System.out.println("sum(40, 50) is: " + sum(40, 50) ); //40+41+...+50
}
7
" # $ %&"
(%)(** %+&#
+
8
(%)(** ((*"*((*$
%+&# +,# % +& # +,# +
+,# +
%+'.&-'. %+'.&-
%+&# +,# % +& # +,# +
+,# +
%+'.&-'. %+'.&-
1/30/2012 12
/
/ / (1$)(
''
15
16
17
56" 7 8
7%56"
20
21
22
/
/ / (1$)(
/
/
/ / (1$)(
24
'''
25
7%56" 006 0::6 56" :0
'+.
'+.
003
003
/
/ / (1$)(
/
/
/ / (1$)(
*2&2*00)
/
/ / (1$)(
*2&2*00
/
00
00 6 *2&2*00
''
33
/
00
00 6 *2&2*00
''
getBalance deposit withdraw transfer
Earns interest that compounds monthly Earns interest that compounds monthly
no interest small number of free transactions per month, additional transactions are charged a small fee
(inherited from 3$<) 7 (new to 7$<)
3 (inherited from 3$<) 3 (inherited from 3$<) (overrides 3$< method) – need to update the transaction count )) (overrides 3$< method) – need to update the transaction count 8 (new to CheckingAccount)
7
'''
'''
1/30/2012 46