Professional Documents
Culture Documents
java
package lab2;
System.exit(0);
}
public static String getFileName()
{
String file; // To hold file name
// loop processes the lines read from the file until end of the file
// use while & hasNext
while(read.hasNextLine())
{
// Read from file and store in marks
marks = read.nextDouble();
AccountTest.java
package lab2;
System.exit(0);
PrepaidAccount.java
package lab2;
// Method to subtract amount from the balance field - using double type
argument
public void out(double amount)
{
balance -= amount;
}
// Method to subtract amount from the balance field - using String type
argument
public void out(String str)
{
balance -= Double.parseDouble(str);
}