Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. import TerminalIO.KeyboardReader;
  2. public class Renovation
  3. {
  4. public static void main(String [] args)
  5. {
  6.  
  7. KeyboardReader reader = new KeyboardReader();
  8.  
  9. //constants
  10. final double tileSize = 9.0/12.0;
  11. final double subfloorSize = 2;
  12. final double tileCost = .45;
  13. final double subfloorCost = 3;
  14. final double adhesiveCost = 16;
  15. final double baseboardCost = 10;
  16. final double tileLabor = .5;
  17. final double subfloorLabor = .5;
  18. final double baseboardLabor = 6;
  19. final double adhesiveLabor = 10;
  20. final double adhesiveSubfloor6x8 = 15;
  21. //other variables
  22. double perimeter;
  23. double area;
  24. double length;
  25. double width, feetOfBase;
  26. double costOfBaseboard;
  27. int numOfTiles, numOfSubfloor, galOfAdhesive;
  28.  
  29.  
  30. System.out.print("Please enter in the width of the room: ");
  31. width = reader.readDouble();
  32. System.out.print("Please enter in the length of the room: ");
  33. length = reader.readDouble();
  34.  
  35. area = length * width;
  36. perimeter = length + length + width + width;
  37.  
  38.  
  39. //Figuring out the amount of materials
  40. numOfTiles = (int)(area / (tileSize * tileSize)+ 1);
  41. numOfSubfloor = (int) (area / 4);
  42. galOfAdhesive = (int) (((numOfSubfloor / adhesiveSubfloor6x8)/2)* 2);
  43. System.out.println("\n\nMaterials List\n============================================");
  44. System.out.println("Number of tiles: \t\t\t\t" + numOfTiles);
  45. System.out.println("Number of subfloor squares: \t" + numOfSubfloor);
  46. System.out.println("Feet of Baseboard: \t\t\t\t" + perimeter);
  47. System.out.println("Gallons of Adhesive: \t\t\t" + galOfAdhesive);
  48. System.out.println("============================================\n\n\nCost of Materials");
  49. System.out.println("Cost of Tiles: " + numOfTiles * tileCost);
  50. System.out.println("Cost of Subfloor: " + numOfSubfloor * subfloorCost);
  51. System.out.println("Cost of Baseboard: " + costOfBaseboard;
  52. System.out.println("Cost of Adhesive: " + galOfAdhesive * adhesiveCost);
  53.  
  54.  
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement