|
home—info—lects—labs—exams—hws
textbook—tutor/PIs—java.lang docs—java.util docs
Recall that && and || each take two booleans, and return a boolean. For example:
// These evaluate to either true or false, depending // on what value the variables have: (ptsPossible == 0) || (ptsEarned / ptsPossible > 0.85) (numTickets <= seatsOnPlane) || (seatsOnPlane > 0) |
Discussion question:
// SOME INCORRECT CODE: String waterForm( double temp ) { if (temp < 32 && > 212) { return "not liquid"; } else { return "liquid"; } } |
Your task: P5.12 from the textbook: Revise BankAccount so that:
Here is the BankAccountTester.java and BankAccount.java we wrote in class.
First add test cases which include:
1If you also want to print a warning message to System.err, that would be eminently reasonable, but not required. ↩
home—info—lects—labs—exams—hws
textbook—tutor/PIs—java.lang docs—java.util docs
©2009, Ian Barland, Radford University Last modified 2009.Mar.17 (Tue) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |