-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalculate_tiles.java
More file actions
25 lines (23 loc) · 889 Bytes
/
Copy pathCalculate_tiles.java
File metadata and controls
25 lines (23 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.util.*;
public class Calculate_tiles
{
public static void main(String[] args)
{
System.out.println("Enter width of the room : ");
Scanner sc = new Scanner(System.in);
float rlength = sc.nextFloat();
System.out.println("Enter length of the room : ");
float rwidth = sc.nextFloat();
float rtotal = rlength*rwidth;
System.out.println("Enter width of the tile : ");
float slength = sc.nextFloat();
System.out.println("Enter length of the tile : ");
float swidth = sc.nextFloat();
float stotal = slength*swidth;
float total = rtotal/stotal;
if(total == (int)total)
System.out.println("The average number of tile are need is "+(int)total);
else
System.out.println("The average number of tile are need is "+(int)(total+1));
}
}