Java Coding

 import java.util.Scanner;


public class TileQuality {


    public static void main(String[] args) {


        Scanner input = new Scanner(System.in);


        double L, W, TL, TW, T;

        double floor_area, tile_area, tiles_needed;

        String quality;


        System.out.print("Enter floor length (m): ");

        L = input.nextDouble();


        System.out.print("Enter floor width (m): ");

        W = input.nextDouble();


        System.out.print("Enter tile length (m): ");

        TL = input.nextDouble();


        System.out.print("Enter tile width (m): ");

        TW = input.nextDouble();


        System.out.print("Enter tile thickness (mm): ");

        T = input.nextDouble();


        floor_area = L * W;

        tile_area = TL * TW;

        tiles_needed = floor_area / tile_area;


        if (T >= 8) {

            quality = "High Quality";

        } else if (T >= 5) {

            quality = "Medium Quality";

        } else {

            quality = "Low Quality";

        }


        System.out.println("Number of tiles needed = " + Math.ceil(tiles_needed));

        System.out.println("Tile Quality = " + quality);


        input.close();

    }

}

Comments

Popular posts from this blog

Milestones Of Computing and Programming Languages

Flow chat