![LaytonHall79](/avatars/1388.jpg)
LaytonHall79
19.10.2020 •
Computers and Technology
A shop will give discount of 10% if the
cost of purchased quantity is more than 100
Ask user for quantity
Suppose, one unit will cost 100
Judge and print total cost for user
Solved
Show answers
More tips
- F Food and Cooking How to Make Chebureki: A Delicious Recipe for Russian Street Food...
- A Animals and plants Unraveling the Mystery of Loch Ness: What Does the Loch Ness Monster Look Like?...
- L Leisure and Entertainment Should You Buy a Ceramic Knife?...
- C Computers and Internet How to easily and quickly disable Firebug in Gmail and Google Docs...
- G Goods and services How to sew a ribbon: Tips for beginners...
- F Food and Cooking How to Make Mayonnaise at Home? Secrets of Homemade Mayonnaise...
- C Computers and Internet Which Phone is Best for Internet Surfing?...
- F Food and Cooking Everything You Need to Know About Pasta...
- C Computers and Internet How to Choose a Monitor?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
Answers on questions: Computers and Technology
- C Computers and Technology What will happen if you type pseudocode in another language s programming environment and try to run the program?...
- C Computers and Technology Suppose Host A sends Host B a TCP segment encapsulated in an IP datagram. When Host B receives the datagram, how does the network layer in Host B know it should...
- C Computers and Technology Write a function ngrams(n, tokens) that produces a list of all n-grams of the specified size from the input token list. Each n-gram should consist of a 2-element...
- C Computers and Technology Write a brief report to the director of retail operations that explains the management skills and practices you feel will improve team productivity and efficiency,...
- C Computers and Technology In computing, miniature computers are embedded into our cars, cameras, kitchen appliances, home heating systems, clothing, and even our bodies....
- C Computers and Technology When did hacking start developing?...
- M Mathematics Joey uses the equation y=kx to determine how much money (y) he earns after working any number of hours (x) joey earned $450 after 40 hours what value of k in joeys...
- S Social Studies The preamble to the u.s. constitution called for a new system of government that could promote the general welfare. which of these is the best example of that role...
- M Mathematics Evaluate the determinant ( will pick brainiest) [tex] \left[\begin{array}{ccc}x& 1& -1\\x^2& x& x\\0& x& 1\end{array}\right] [/tex] plz you...
- M Mathematics The weather forecast states that the temperature will be lower than –7°f tonight. let t represent the temperature in degrees fahrenheit. which inequality models...
Ответ:
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));
}
}