-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreditCard.java
More file actions
33 lines (20 loc) · 776 Bytes
/
Copy pathCreditCard.java
File metadata and controls
33 lines (20 loc) · 776 Bytes
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
27
28
29
30
31
32
33
import java.util.Scanner;
public class CreditCard {
public static void main(String... args){
Scanner input = new Scanner(System.in);
System.out.print("The new account number is: ");
int accountNumber = input.nextInt();
System.out.print("The balance at the beginning of the month is: ");
int balance = input.nextInt();
System.out.print("The total charges is: ");
int totalCharges = input.nextInt();
System.out.print("The total credit: ");
int totalCredit = input.nextInt();
System.out.print("The credit limit: ");
int creditLimit = input.nextInt();
int newBalance = balance + totalCharges + totalCredit;
System.out.println("The new balance is: " + newBalance);
if (newBalance > creditLimit)
System.out.print("The credit limit is exceeded");
}
}