-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreditcardcalculator.java
More file actions
47 lines (37 loc) · 1.6 KB
/
creditcardcalculator.java
File metadata and controls
47 lines (37 loc) · 1.6 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// collect input from user
// collect the credit card limit on a charge account
// collect account number
// collect balance at the begiining of the month
// collect total of all items charged by the customer this month
// collect total of all credits applied to the cutomer's account this month
// collect credit limit
// calculate the new balance
// display the new balance
// determine whether the new balance exceeds customer credit limit
// if credit limit is exceeded, print credit limit is exceeded
import java.util.Scanner;
public class creditCardCalculator{
public static void main(String [] args){
Scanner input = new Scanner(System.in);
System.out.println("Enter credit card limit: ");
int cardlimit = input.nextInt();
System.out.println("Account number: ");
int acctno = input.nextInt();
System.out.println("Balance at the beginning of the month: ");
int balance = input.nextInt();
System.out.println("total of all items charged by cutomer this month: ");
int items = input.nextInt();
System.out.println("total of all credits applied to the customer's account this month: ");
int credits = input.nextInt();
System.out.println("allowed credit limits: ");
int limits = input.nextInt();
newbalance = ("beginning balance + charges - credits");
System.out.println("The new balance is: ", newbalance);
if(newbalance >= customercreditlimit){
System.out.println("Credit limit not exceeded");
}
else{
System.out.println("Credit limit exceeded");
}
}
}