naomi9601
21.01.2021 •
Mathematics
Solve the following 4 6/10+6 8/10
Solved
Show answers
More tips
- H Health and Medicine How to Improve Eyesight: Science-based Techniques to Enhance Your Visual Acuity...
- F Family and Home Do Lullabies Help Babies Sleep or Is it Just a Myth?...
- H Health and Medicine Tick Traps: How to Remove Them Safely and Effectively...
- S Society and Politics Why are thugs called gopniks ? A fascinating journey through Russian subculture...
- A Animals and plants Want a Perfect Lawn? Learn How to Plant Grass the Right Way...
- A Animals and plants How to Properly Care for a Pet Decorative Rabbit at Home?...
- C Computers and Internet How to Check the Speed of My Internet?...
- H Health and Medicine 10 Ways to Cleanse Your Colon and Improve Your Health...
- W Work and Career How to Write a Resume That Catches the Employer s Attention?...
- C Computers and Internet Е-head: How it Simplifies Life for Users?...
Answers on questions: Mathematics
- M Mathematics Help! anyone know this answer...
- M Mathematics A manufacturer inspects a sample of 500 smart phones and finds that 496 of them have no defects. The manufacturer sent a shipment of 2000 smartphones to a distributor. Predict the...
- H History An insurance deductible is ... A) the contract fee applied to the monthly premium. B) the monthly premium on an insurance policy. C) the amount you owe before insurance will cover...
- B Biology Force and motion : the change of position over time is...
- E English Write the bare infinitive. fell felt knew learnt met put travelled...
Ответ:
Ответ:
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));
}
}