![lilyforeman5867](/avatars/13734.jpg)
lilyforeman5867
20.09.2020 •
Mathematics
Which units are incommensurable with meters?
Acres, Hours, Kilomters, Kilograms
Solved
Show answers
More tips
- L Legal consultation What Documents Are Required for a Russian Passport?...
- S Sport How to Choose Tennis Rackets?...
- H Health and Medicine AKDS Vaccination: Ensure Your Child s Safety...
- H Health and Medicine Naskol ko Opasen Ukus Kleshcha i Kak Ego Raspoznat...
- C Computers and Internet How to Delete Your Account on Odnoklassniki...
- H Health and Medicine What to Do When Your Jaw Locks Up?...
- G Goods and services What Are the Most Popular Services?...
- P Philosophy How did the concept of module arise in computer science?...
Answers on questions: Mathematics
- M Mathematics Help Which function is best represented by this graph...
- M Mathematics Solve by using substitution -4 + y=6 -5x -y =21...
- M Mathematics (7.067) = (9.320) + (5.314) = (2.87)...
- M Mathematics Help with this math Please and I appreciate it so much if u did...
- M Mathematics If you multiply the same number to both sides of an equation, the equation is still true. For example if a = then a x c= bxc....
- M Mathematics Tony had $350 in the savings account. His bank statement showed two transactions, a withdrawal as negative $45 and a deposit of $25. What is the balance in his savings...
- M Mathematics If the shapes are scaled copies, which of the following are reasonable scale factors that could be applied to shape 1 to create shape 2....
- M Mathematics What is the measure if angle A...
- M Mathematics Please help me with my math evaluate the expressions...
- M Mathematics Jose bought 4.75 pounds of pecans at $5.80 per pound. how much did jose pay for the pecans...
Ответ:
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));
}
}