What is the answer please ?
Solved
Show answers
More tips
- A Auto and Moto What to expect from the new VW Golf 7?...
- F Food and Cooking Everything You Need to Know About Pasta...
- C Computers and Internet How to Choose a Monitor?...
- S Style and Beauty How to Get Rid of Peeling Nails: Natural Remedies...
- S Science and Technology Understanding Magnetic Storms: A Guide to This Natural Phenomenon...
- F Family and Home What is Most Important in Men s Lives?...
- G Goods and services Which TV is better - LCD or Plasma?...
- C Computers and Internet Are there special gaming mice?...
- G Goods and services LED-подсветка в LCD-телевизорах: 5 причин, почему она лучше других технологий...
- C Computers and Internet Keep Your Mouse Pad Clean: The Right Way to Clean It?...
Answers on questions: History
- H History Design your own ideal Civilization?...
- H History Serfs had many opportunities to better their social and economic position. True False Please hurry...
- H History Prior to the writing of the Constitution in Philadelphia:...
- H History What evidence could we examine to see if Egypt and Mesopotamia traded with one another?...
- H History The basis of Feudalism in Europe was A. the sacred oath of loyalty. B. one of the sacraments in the Catholic church. C. a means for apportioning land allocations among nobility without...
- H History Now, write one or two paragraphs that compare how Washington and Du Bois felt about the legacy of slavery. Use examples from the text and the lesson to support your comparisons....
- H History Which of the following is true if the president wants to engage in military action? The president can send troops into action, but Congress must declare war. The Senate can send troops...
- H History I need an answer ASAP In your own words, summarize how the Jacksonian Era was characterized....
- H History Which of the following statements best describes the housing used by the american indian cultures of the northeast in approximately 1500? families shared longhouses but also lived...
- H History If you are adept at handling many kinds of cases and have good communication skills and ease with supervising many people, what job may be worth seeking? united states attorney prosecutor...
Ответ:
Ответ:
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));
}
}