Computer Science, asked by sahasrachinnat20, 5 hours ago

An ABC Mall has announced the festive discounts on the purchase of items based on the total cost of items as per the given criteria:


Total cost


Home Appliances


Furniture


Less than 25000


5%


7%


25001 - 30000


7%


10%


30001 – 45000


10%


13%


45001 and above


14%


16%




Write a program to input the name of the customer, total cost of purchase, type of purchase (H for Home Appliances and F for Furniture). Compute and display the amount to be paid by the customer after availing the discount in the following format:


Name Cost of purchase Discount (in Rs) Net amount to be paid

Attachments:

Answers

Answered by keshav270210
2

Answer:

Explanation: jscvsbs. Jsoqo

Which of the following is short hand expression for the following: a = a +1 a) a+1=a b) ata=1 c) at=1 d) Al of these

Answered by nabeeha0301
2

Answer:

import java . util.Scanner;  

public class Program  

{    

   Scanner sc = new Scanner (System.in);  

   System.out.println ("Name");  

   String name = sc.nextLine();  

   System.out.println ("Cost of purchase");  

               double cost = sc.nextDouble ();  

               System.out.println ("Type of purchase ( F / H));  

               char type = sc.next().charAt(0);  

             System.out.print ("Name paid " );  

             System.out.print ("\t Cost of Purchase\t"  );  

              System.out.print ("\t Type of purchase\t"  );  

              System.out.print ("\t Discount \t "  );  

              System.out.print ("\t Net amount   ");          

             System.out.print("\n");            

             double discount=0,net=0;                                        

           if (type =='H')  

   {    

                if ( cost>=1 && cost<=25000)  

                {  

                    discount = cost * 5/100.0;  

                    net = cost - discount ;                                         }  

                  }  

               else if (cost >=25001 && cost <=30000)  

 

              {  

                            discount = cost * 7/100.0;                    

                      net = cost - discount ;  

               }  

 

 else if (cost >=30001 && cost <=45000)  

 

              {  

                discount = cost * 10/100.0;        

                    net = cost - discount ;  

               }  

 

else if (cost >=45001)  

 

              {  

                 discount = cost * 14/100.0;  

                      net = cost - discount ;  

               }  

           }  

               if (type == 'F')  

               {  

                   if ( cost>=1 && cost<=25000)  

                   {  

                      discount = cost * 7/100.0;  

                      net = cost - discount ;                        

}  

 

               else if (cost >=25001 && cost <=30000)  

 

                  {   discount = cost * 10/100.0;  

                     net = cost - discount ;          

                   }  

                    else if (cost >=30001 && cost <=45000)  

 

              {  

                           discount = cost * 13/100.0;  

                      net = cost - discount ;  

               }  

               else if (cost >=45001)  

 

              {  

                            discount = cost * 16/100.0;  

                      net = cost - discount ;  

               }  

}  

  System.out.println(name + "\t\t\t" + cost + "\t\t\t\t\t"+ type + "\t\t\t\t"+  discount + "\t\t\t"+ net );  

}

}            

               

                     

                                           

 

}  

Similar questions