java
mrwWeek02Example/.classpath
mrwWeek02Example/.project
mrwWeek02Example org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature
mrwWeek02Example/.settings/org.eclipse.jdt.core.prefs
#Wed Oct 27 16:35:58 CDT 2010 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.5
mrwWeek02Example/bin/BankAccount.class
public synchronized class BankAccount { private String customer; private int accountNum; public void BankAccount(); public void setCustomer(String); public void setAccountNum(int); public void printAccountInfo(); }
mrwWeek02Example/bin/BankAccountDriver.class
public synchronized class BankAccountDriver { public void BankAccountDriver(); public static void main(String[]); }
mrwWeek02Example/src/BankAccount.java
mrwWeek02Example/src/BankAccount.java
public
class
BankAccount
{
private
String
customer
;
// customer's name
private
int
accountNum
;
// bank account number
//**************************************************
public
void
setCustomer
(
String
customer
)
{
this
.
customer
=
customer
;
}
// end setCustomer
public
void
setAccountNum
(
int
accountNum
)
{
this
.
accountNum
=
accountNum
;
}
// end setAccountNum
//**************************************************
// This method prints a bank account's information.
public
void
printAccountInfo
()
{
System
.
out
.
println
(
this
.
customer
+
"'s account number is "
+
this
.
accountNum
+
"."
);
}
// end printAccountInfo
}
// end class BankAccount
mrwWeek02Example/src/BankAccountDriver.java
mrwWeek02Example/src/BankAccountDriver.java
/***********************************************
* BankAccountDriver.java
* Dean & Dean
*
* This is the driver for the BankAccount class.
**********************************************/
import
java
.
util
.
Scanner
;
public
class
BankAccountDriver
{
public
static
void
main
(
String
[]
args
)
{
Scanner
stdIn
=
new
Scanner
(
System
.
in
);
BankAccount
myBankAccount
=
new
BankAccount
();
System
.
out
.
print
(
"Customer name: "
);
myBankAccount
.
setCustomer
(
stdIn
.
nextLine
());
System
.
out
.
print
(
"Account number: "
);
myBankAccount
.
setAccountNum
(
stdIn
.
nextInt
());
myBankAccount
.
printAccountInfo
();
}
// end main
}
// end class BankAccountDriver