Answer:
import java.util.*;
import java.text.*;
class CreditCardBill
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
NumberFormat defaultFormat = NumberFormat.getCurrencyInstance(Locale.US);
System.out.println("CS Card International Statement");
System.out.println("===============================");
System.out.print("Previous Balance: $");
double prevBalance = sc.nextDouble();
System.out.print("Additional Charges: $");
double addCharges = sc.nextDouble();
double interest;
if(prevBalance == 0)
interest = 0;
else
interest = (prevBalance + addCharges) * 0.02;
System.out.println("Interest: "+defaultFormat.format(interest));
double newBalance = prevBalance + addCharges + interest;
System.out.println("New Balance: "+defaultFormat.format(newBalance));
double minPayment;
if(newBalance < 50)
minPayment = newBalance;
else if(newBalance <= 300)
minPayment = 50.00;
else
minPayment = newBalance * 0.2;
System.out.println("Minimum Payment: "+defaultFormat.format(minPayment));
}
}