Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+8 votes

import java.io.;
import java.util.
;
public class test {
public static void main(String [] args) throws FileNotFoundException {

Scanner console= new Scanner( new File("transactions.txt"));
PrintStream outPut = new PrintStream( new File("put.txt"));
double c=0;
double x = console.nextDouble();
while ( console.hasNextLine()) {
	String token= console.next();
	for (int i=1; i<=4;i++) {
	if (token.equals("Deposit")){
	
	
	
	c += x;
	outPut.print("Balance "+i+": $"+c);
	}else {
		c -= x;
		outPut.print("Balance "+i+": $"+c);
	}
	}
	
	
}

}
}

asked in CSC211_Winter2018 by (1 point)

1 Answer

+1 vote

did you create an actual transaction.txt file like we had in the last lab? if not you have to do that becuase we don't know how many transactions we have

answered by (1 point)
...