Advertisement
discogood

homework

Jan 21st, 2018
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class EbayCalculator {
  5.  
  6. public static void main(String[] args) {
  7.  
  8. Scanner input = new Scanner(System.in);
  9.  
  10.  
  11. double winningBid = input.nextDouble();
  12. System.out.print("How much was the winning bid? ");
  13.  
  14.  
  15. double cost = input.nextDouble();
  16. System.out.print("How much did you pay for the item originally? ");
  17.  
  18.  
  19. double shipping = input.nextDouble();
  20. System.out.print("How much will it cost you to ship the item? ");
  21.  
  22.  
  23. double ebayCharge = input.nextDouble();
  24. System.out.print("What's the percentage that ebay charges you? ");
  25.  
  26.  
  27. double paypalCharge = input.nextDouble();
  28. System.out.print("What's the percentage that paypal charges you? ");
  29.  
  30.  
  31. double netProfit = winningBid - cost - shipping - ebayCharge - paypalCharge;
  32.  
  33. System.out.println("Your net profit is + netProfit");
  34.  
  35.  
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement