In: Computer Science
public class Q8 { public static void main(String[] args) { //Nancy did an online shopping at Macy's.com on a week end sale. //She purchased a bedding collection on a 60 % sale. It is original price was $ 450 //She added this item in the shopping cart and then during check out, the web portal // notified Nancy that she was qualified // to get an extra offer of 20 % off from the previous discounted price. //The Shipping charge was $ 25 and tax was 8.5 %. // Compute the final price and total bill amount including taxes and shipping charge. //print the price after discounts, savings, tax, shipping, and total bill amount } }
import java.util.Scanner;
public class Q8
{
public static void main(String[] args)
{
double price_after_first_discount;
double price_after_second_discount;
double tax;
double total_biilling_amount;
double saving;
double amount=450;
double shipping=25;
price_after_first_discount=amount-(amount*60/100);
price_after_second_discount=price_after_first_discount-(price_after_first_discount*20/100);
tax=price_after_second_discount*8.5/100;
total_biilling_amount=tax+shipping+price_after_second_discount;
saving=amount-total_biilling_amount;
System.out.println("Saving amount: "+saving);
System.out.println("tax amount: "+tax);
System.out.println("shipping amount: "+shipping);
System.out.println("total bill amount:
"+total_biilling_amount);
}
}