Advertisement
AnindyaBiswas

Revenue

Apr 27th, 2022
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class revenue {
  4.     public static void main(String args[])
  5.     {
  6.         Scanner sc = new Scanner(System.in);
  7.         System.out.print("Enter no of products : ");
  8.         int n = sc.nextInt();
  9.    
  10.         System.out.print("Enter price of each product : ");
  11.         float price = sc.nextFloat();
  12.         float Revenue = price * n;
  13.         if (Revenue < 5000.00)
  14.             System.out.print("Revenue : " + Revenue);
  15.         else
  16.         {
  17.             float Discount = Revenue/10;
  18.             System.out.print("Congrats!!!\n You have a 10% Discount!");
  19.             System.out.print("\nDiscounted amount : " + Discount + "\nDiscounted Revenue : "+ (Revenue - Discount));
  20.         }
  21.     }
  22.    
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement