Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import TerminalIO.KeyboardReader;
- public class Renovation
- {
- public static void main(String [] args)
- {
- KeyboardReader reader = new KeyboardReader();
- //constants
- final double tileSize = 9.0/12.0;
- final double subfloorSize = 2;
- final double tileCost = .45;
- final double subfloorCost = 3;
- final double adhesiveCost = 16;
- final double baseboardCost = 10;
- final double tileLabor = .5;
- final double subfloorLabor = .5;
- final double baseboardLabor = 6;
- final double adhesiveLabor = 10;
- final double adhesiveSubfloor6x8 = 15;
- //other variables
- double perimeter;
- double area;
- double length;
- double width, feetOfBase;
- double costOfBaseboard;
- int numOfTiles, numOfSubfloor, galOfAdhesive;
- System.out.print("Please enter in the width of the room: ");
- width = reader.readDouble();
- System.out.print("Please enter in the length of the room: ");
- length = reader.readDouble();
- area = length * width;
- perimeter = length + length + width + width;
- //Figuring out the amount of materials
- numOfTiles = (int)(area / (tileSize * tileSize)+ 1);
- numOfSubfloor = (int) (area / 4);
- galOfAdhesive = (int) (((numOfSubfloor / adhesiveSubfloor6x8)/2)* 2);
- System.out.println("\n\nMaterials List\n============================================");
- System.out.println("Number of tiles: \t\t\t\t" + numOfTiles);
- System.out.println("Number of subfloor squares: \t" + numOfSubfloor);
- System.out.println("Feet of Baseboard: \t\t\t\t" + perimeter);
- System.out.println("Gallons of Adhesive: \t\t\t" + galOfAdhesive);
- System.out.println("============================================\n\n\nCost of Materials");
- System.out.println("Cost of Tiles: " + numOfTiles * tileCost);
- System.out.println("Cost of Subfloor: " + numOfSubfloor * subfloorCost);
- System.out.println("Cost of Baseboard: " + costOfBaseboard;
- System.out.println("Cost of Adhesive: " + galOfAdhesive * adhesiveCost);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement