Advertisement
Emmet_Mc

Photocopy

Jan 28th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package selection1;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11. *
  12. * @author Emmet
  13. */
  14. public class Exercise2 {
  15. public static void main(String[] args) {
  16. Scanner keyboard = new Scanner(System.in);
  17.  
  18. //Declare Variables
  19. double numcopies = 0;
  20. double totalcost = 0;
  21.  
  22. //Get Input
  23. System.out.println("Enter Number Of Copies");
  24. numcopies = keyboard.nextDouble();
  25.  
  26. //Do Calculations
  27. if (numcopies <= 50)
  28. {
  29. totalcost = numcopies * 0.05;
  30. System.out.println("The Total Cost Is €" + totalcost);
  31. }
  32. else if(numcopies > 50 && numcopies <= 90)
  33. {
  34. totalcost = ((numcopies - 50) * 0.04) + (50 * 0.05);
  35. System.out.println("The Total Cost Is €" + totalcost);
  36. }
  37. else if (numcopies > 90)
  38. {
  39. totalcost = ((40 * 0.04) + (50 * 0.05) + ((numcopies - 90) * 0.03));
  40. System.out.println("The Total Cost Is €" + totalcost);
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement