-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathD2-5.txt
26 lines (24 loc) · 837 Bytes
/
D2-5.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.Scanner;
class Account {
public static void main(String[] args) {
double balance = 0;
double minbal = 500;
double depositAmt = 0;
//Scanner sc = new Scanner(System.in); // uncomment when working in eclipse
while(depositAmt < minbal) {
System.out.println("$100 have been added to account");
//depositAmt = sc.nextInt(); // harcode different depositAmt values
// uncomment when working in eclipse
depositAmt +=100;
}
balance = depositAmt;
System.out.println("Transaction Complete");
}
}
Output:
$100 have been added to account
$100 have been added to account
$100 have been added to account
$100 have been added to account
$100 have been added to account
Transaction Complete