Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class revenue {
- public static void main(String args[])
- {
- Scanner sc = new Scanner(System.in);
- System.out.print("Enter no of products : ");
- int n = sc.nextInt();
- System.out.print("Enter price of each product : ");
- float price = sc.nextFloat();
- float Revenue = price * n;
- if (Revenue < 5000.00)
- System.out.print("Revenue : " + Revenue);
- else
- {
- float Discount = Revenue/10;
- System.out.print("Congrats!!!\n You have a 10% Discount!");
- System.out.print("\nDiscounted amount : " + Discount + "\nDiscounted Revenue : "+ (Revenue - Discount));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement