Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1.  
  2. import java.util.Scanner; //Import Scanner
  3. public class Live_Test_Java {
  4. public static void main(String[] args) {
  5. Scanner input = new Scanner(System.in); //Open Scanner
  6.  
  7. //PART A
  8. /*
  9. int length, width, tiles;
  10. float cost, price;
  11.  
  12. System.out.println("Enter Length:");
  13. length = input.nextInt();
  14. System.out.println("Enter Width:");
  15. width = input.nextInt();
  16. System.out.println("Enter Cost:");
  17. cost = input.nextFloat();
  18.  
  19. tiles = length * width;
  20. System.out.println("Number of tiles: " + tiles);
  21. price = (float) tiles * cost;
  22. System.out.println("Cost of tiles: " + price);
  23. */
  24.  
  25. //Part B
  26. /*
  27. int length, width, type, tiles;
  28. float cost, price;
  29.  
  30. System.out.println("Enter Length:");
  31. length = input.nextInt();
  32. System.out.println("Enter Width:");
  33. width = input.nextInt();
  34. System.out.println("Enter type of tile:");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement