-2

I am trying to convert this Node.js script over to C# :

/*
Name : paintRoomCalc in node.js
Author : Аїӡек Меѥҏ
Version : v1.0
License : N/A
*/

const prompt = require('prompt-sync')();
const colors = require('colors');

function getLayers(roomWidth, roomDepth, roomHeight, paintThick) {
  var edgeArea, edgeSideDepthArea, edgeSideDepthVol, edgeSideWidthArea, edgeSideWidthVol, edgeUpArea, edgeUpVol, edgeVol, i, roomVol, t, wallArea, wallFive, wallOne, wallThree, wallVol;
  i = 0;
  t = 0;
  roomWidth = (roomWidth * 12);
  roomDepth = (roomDepth * 12);
  roomHeight = (roomHeight * 12);
  roomVol = ((roomWidth * roomDepth) * roomHeight);
  while ((roomVol >= 0)) {
    wallOne = (roomWidth * roomHeight);
    wallThree = (roomDepth * roomHeight);
    wallFive = (roomDepth * roomWidth);
    wallVol = ((((wallOne * 2) + (wallThree * 2)) + wallFive) * paintThick);
    wallArea = (((wallOne * 2) + (wallThree * 2)) + wallFive);
    roomWidth = (roomWidth - (paintThick * 2));
    roomDepth = (roomDepth - (paintThick * 2));
    roomHeight = (roomHeight - (paintThick * 2));
    edgeUpVol = (roomHeight * Math.pow(paintThick, 2));
    edgeUpVol = (edgeUpVol * 2);
    edgeUpArea = (roomHeight * paintThick);
    edgeUpVol = (edgeUpArea * 2);
    edgeSideDepthVol = (roomDepth * Math.pow(paintThick, 2));
    edgeSideDepthVol = (edgeSideDepthVol * 2);
    edgeSideDepthArea = (roomDepth * paintThick);
    edgeSideWidthVol = (roomWidth * Math.pow(paintThick, 2));
    edgeSideWidthVol = (edgeSideWidthVol * 2);
    edgeSideWidthArea = (roomWidth * paintThick);
    edgeVol = ((edgeUpVol + edgeSideWidthVol) + edgeSideDepthVol);
    edgeArea = ((edgeUpArea + edgeSideWidthArea) + edgeSideDepthArea);
    roomVol = ((roomVol - wallVol) - edgeVol);
    wallArea = (wallArea - edgeArea);
    i += 1;
    t += wallArea;
  }
  console.log(colors.magenta(i.toString() + " layers to fill your room with paint!!"));
  console.log(colors.magenta(("& " + (t / 4800).toString()) + " gallons of paint"));
}
console.log(colors.bgBlack.green("Paint Layer Calculator"));
console.log(colors.bgBlack.green("by : Аїӡек Меѥҏ"));
console.log("\n")
let roomWidth = prompt(colors.blue("Room Width in Feet? "));
roomWidth = Number(roomWidth);
let roomDepth = prompt(colors.blue("Room Depth in Feet? "));
roomDepth = Number(roomDepth);
let roomHeight = prompt(colors.blue("Room Height in Feet? "));
roomHeight = Number(roomHeight);
console.log("\n");
console.log(colors.red("1 mil is 1/1000 of an inch"));
let paintThickMil = prompt(colors.blue("Paint Thickness in Mils? "));
paintThickMil = Number(paintThickMil);
paintThick = (paintThickMil / 1000);
console.log("\n");
console.log(colors.bgBlack.green("Calculating..."));
getLayers(roomWidth, roomDepth, roomHeight, paintThick);

so far I've gotten this far :

/*
Name : paintRoomCalc in C#
Author : Аїӡек Меѥҏ
Version : b0.1
License : N/A
*/


using System;
class MainClass {
    public void getLayers(int roomWidth, int roomDepth, int roomHeight, int paintThick) {
        int edgeArea, edgeSideDepthArea, edgeSideDepthVol, edgeSideWidthArea, edgeSideWidthVol, edgeUpArea, edgeUpVol, edgeVol, roomVol, wallArea, wallFive, wallOne, wallThree, wallVol;
        double i = 0;
        double t = 0;
        roomWidth = (roomWidth * 12);
        roomDepth = (roomDepth * 12);
        roomHeight = (roomHeight * 12);
        roomVol = ((roomWidth * roomDepth) * roomHeight);
        while ((roomVol >= 0)) {
            wallOne = (roomWidth * roomHeight);
            wallThree = (roomDepth * roomHeight);
            wallFive = (roomDepth * roomWidth);
            wallVol = ((((wallOne * 2) + (wallThree * 2)) + wallFive) * paintThick);
            wallArea = (((wallOne * 2) + (wallThree * 2)) + wallFive);
            roomWidth = (roomWidth - (paintThick * 2));
            roomDepth = (roomDepth - (paintThick * 2));
            roomHeight = (roomHeight - (paintThick * 2));
            edgeUpVol = (roomHeight * Math.Pow(paintThick, 2));
            edgeUpVol = (edgeUpVol * 2);
            edgeUpArea = (roomHeight * paintThick);
            edgeUpVol = (edgeUpArea * 2);
            edgeSideDepthVol = (roomDepth * Math.Pow(paintThick, 2));
            edgeSideDepthVol = (edgeSideDepthVol * 2);
            edgeSideDepthArea = (roomDepth * paintThick);
            edgeSideWidthVol = (roomWidth * Math.Pow(paintThick, 2));
            edgeSideWidthVol = (edgeSideWidthVol * 2);
            edgeSideWidthArea = (roomWidth * paintThick);   
            edgeVol = ((edgeUpVol + edgeSideWidthVol) + edgeSideDepthVol);
            edgeArea = ((edgeUpArea + edgeSideWidthArea) + edgeSideDepthArea);
            roomVol = ((roomVol - wallVol) - edgeVol);
            wallArea = (wallArea - edgeArea);
            i += 1;
            t += wallArea;
        }
        Console.WriteLine(ToString(i) + " layers to fill your room with paint!!");
        Console.WriteLine(("& " + ToString(t / 4800)) + " gallons of paint");
    }
    public static void Main (String[] args) {
        int roomWidth, roomDepth, roomHeight, paintThickMil, paintThick;
        Console.WriteLine("Paint Layer Calculator");
        Console.WriteLine("by : Аїӡек Меѥҏ");
        Console.WriteLine();

        //get input for room dimentions
        Console.Write("Room Width in Feet? ");
        roomWidth = Console.ReadLine();
        roomWidth = ToInt32(roomWidth);
        Console.Write("Room Depth in Feet? ");
        roomDepth = Console.ReadLine();
        roomDepth = ToInt32(roomDepth);
        Console.Write("Room Height in Feet? ");
        roomHeight = Console.ReadLine();
        roomHeight = ToInt32(roomHeight);
        Console.WriteLine();
        Console.WriteLine("1 mil is 1/1000 of an inch");
        Console.Write("Paint Thickness in Mils? ");
        paintThickMil = Console.ReadLine();
        paintThickMil = ToInt32(paintThickMil);
        paintThick = (paintThickMil / 1000);
        Console.WriteLine();
        Console.WriteLine("Calculating...");
        getLayers(roomWidth, roomDepth, roomHeight, paintThick);
    }
}

I get this error multiple times when trying to compile with mcs :

Cannot implicitly convert type `string' to `int'

I also get this error as well :

Cannot implicitly convert type `double' to `int'. An explicit conversion exists (are you missing a cast?)

it seems as if I'm converting vars incorrectly

I've tried the method approach : int.ToString() && string.ToInt32() like in Node.js, but to no avail

Thanks for your help ahead of time!

Cheers!

EDIT : it's been solved : working code :

/*
Name : paintRoomCalc in C#
Author : Аїӡек Меѥҏ
Version : v1.0
License : N/A
*/


using System;
class MainClass {
    public static void getLayers(int roomWidth, int roomDepth, int roomHeight, int paintThick) {
        int edgeArea, edgeSideDepthArea, edgeSideDepthVol, edgeSideWidthArea, edgeSideWidthVol, edgeUpArea, edgeUpVol, edgeVol, roomVol, wallArea, wallFive, wallOne, wallThree, wallVol;
        double i = 0;
        double t = 0;
        roomWidth = (roomWidth * 12);
        roomDepth = (roomDepth * 12);
        roomHeight = (roomHeight * 12);
        roomVol = ((roomWidth * roomDepth) * roomHeight);
        while ((roomVol >= 0)) {
            wallOne = (roomWidth * roomHeight);
            wallThree = (roomDepth * roomHeight);
            wallFive = (roomDepth * roomWidth);
            wallVol = ((((wallOne * 2) + (wallThree * 2)) + wallFive) * paintThick);
            wallArea = (((wallOne * 2) + (wallThree * 2)) + wallFive);
            roomWidth = (roomWidth - (paintThick * 2));
            roomDepth = (roomDepth - (paintThick * 2));
            roomHeight = (roomHeight - (paintThick * 2));
            edgeUpVol = (roomHeight * (int)Math.Pow(paintThick, 2));
            edgeUpVol = (edgeUpVol * 2);
            edgeUpArea = (roomHeight * paintThick);
            edgeUpVol = (edgeUpArea * 2);
            edgeSideDepthVol = (roomDepth * (int)Math.Pow(paintThick, 2));
            edgeSideDepthVol = (edgeSideDepthVol * 2);
            edgeSideDepthArea = (roomDepth * paintThick);
            edgeSideWidthVol = (roomWidth * (int)Math.Pow(paintThick, 2));
            edgeSideWidthVol = (edgeSideWidthVol * 2);
            edgeSideWidthArea = (roomWidth * paintThick);   
            edgeVol = ((edgeUpVol + edgeSideWidthVol) + edgeSideDepthVol);
            edgeArea = ((edgeUpArea + edgeSideWidthArea) + edgeSideDepthArea);
            roomVol = ((roomVol - wallVol) - edgeVol);
            wallArea = (wallArea - edgeArea);
            i += 1;
            t += wallArea;
        }
        Console.WriteLine(Convert.ToString(i) + " layers to fill your room with paint!!");
        Console.WriteLine(("& " + Convert.ToString(t / 4800)) + " gallons of paint");
    }
    public static void Main (String[] args) {
        string roomWidth, roomDepth, roomHeight, paintThickMil;
        int roomWidthInt, roomDepthInt, roomHeightInt, paintThickMilInt, paintThickInt;
        Console.WriteLine("Paint Layer Calculator");
        Console.WriteLine("by : Аїӡек Меѥҏ");
        Console.WriteLine();

        //get input for room dimentions
        Console.Write("Room Width in Feet? ");
        roomWidth = Console.ReadLine();
        roomWidthInt = Convert.ToInt32(roomWidth);
        Console.Write("Room Depth in Feet? ");
        roomDepth = Console.ReadLine();
        roomDepthInt = Convert.ToInt32(roomDepth);
        Console.Write("Room Height in Feet? ");
        roomHeight = Console.ReadLine();
        roomHeightInt = Convert.ToInt32(roomHeight);
        Console.WriteLine();
        Console.WriteLine("1 mil is 1/1000 of an inch");
        Console.Write("Paint Thickness in Mils? ");
        paintThickMil = Console.ReadLine();
        paintThickMilInt = Convert.ToInt32(paintThickMil);
        paintThickInt = (paintThickMilInt / 1000);
        Console.WriteLine();
        Console.WriteLine("Calculating...");
        getLayers(roomWidthInt, roomDepthInt, roomHeightInt, paintThickInt);
    }
}

to summarize for future readers, Math.Pow cannot do operations on doubles so you have to cast it like this :

(int)Math.Pow(<double>);

also, variables stay one type once declared and you cannot reassign types so you have to have a variable for each type, at least how I did it.

EDIT :

I got the code working as if it was written in Node.js : division of two integers causes problems so the final variables, in getLayers() weren't subtracting because it was subtracting NaN from the final volume. here's the completely working code using various tips from very nice stack overflow members, and my spaghetti code additions. :

/*
Name : paintRoomCalc in C#
Author : Аїӡек Меѥҏ
Version : v1.1
License : N/A
*/


using System;
class MainClass {
    static public void getLayers(float roomWidth, float roomDepth, float roomHeight, float paintThick) {
        float edgeArea, edgeSideDepthArea, edgeSideDepthVol, edgeSideWidthArea, edgeSideWidthVol, edgeUpArea, edgeUpVol, edgeVol, roomVol, wallArea, wallFive, wallOne, wallThree, wallVol;
        double i = 0;
        double t = 0;
        roomWidth = roomWidth * 12;
        roomDepth = roomDepth * 12;
        roomHeight = roomHeight * 12;
        roomVol = roomWidth * roomDepth * roomHeight;
        while ( roomVol >= 0 ) {
            // account for walls
            wallOne = (float)( roomWidth * roomHeight );
            wallThree = (float)( roomDepth * roomHeight );
            wallFive = (float)( roomDepth * roomWidth );
            
            wallVol = (float)( ( ( wallOne * 2 ) + ( wallThree * 2 ) + wallFive ) * paintThick );
            wallArea = (float)( ( wallOne * 2 ) + ( wallThree * 2 ) + wallFive );
            
            roomWidth = (float)( roomWidth - ( paintThick * 2 ) );
            roomDepth = (float)(roomDepth - ( paintThick * 2 ));
            roomHeight = (float)(roomHeight - ( paintThick * 2 ));
            
            // account for edges going up & down
            edgeUpVol = (float)( roomHeight * Math.Pow(paintThick, 2) );
            edgeUpVol = (float)( edgeUpVol * 2 );
            edgeUpArea = (float)( roomHeight * paintThick );
            edgeUpVol = (float)( edgeUpArea * 2 );
            
            // account for edges going side to side {on ceiling}
            //// account for edges going side to side {depth}
            edgeSideDepthVol = (float)( roomDepth * Math.Pow(paintThick, 2) );
            edgeSideDepthVol = (float)( edgeSideDepthVol * 2 );
            edgeSideDepthArea = (float)( roomDepth * paintThick );
            //// account for edges going side to side {width}
            edgeSideWidthVol = (float)( roomWidth * Math.Pow(paintThick, 2) );
            edgeSideWidthVol = (float)( edgeSideWidthVol * 2 );
            edgeSideWidthArea = (float)( roomWidth * paintThick );
            
            // add edges
            edgeVol = (float)( edgeUpVol + edgeSideWidthVol + edgeSideDepthVol );
            edgeArea = (float)( edgeUpArea + edgeSideWidthArea + edgeSideDepthArea );
            
            // calculate final values
            roomVol = (float)( roomVol - wallVol - edgeVol );
            wallArea = (float)( wallArea - edgeArea );
            
            i += 1;
            t += wallArea;
        }
        Console.WriteLine(i + " layers to fill your room with paint!!");
        Console.WriteLine("& " + t / 4800 + " gallons of paint");
    }
    static public void Main(string[] args) {
        float roomWidth, roomDepth, roomHeight, paintThickMil; 
        float paintThick;
        Console.WriteLine("Paint Layer Calculator");
        Console.WriteLine("by : Аїӡек Меѥҏ");
        Console.WriteLine();
        
        //get input for room dimensions
        Console.Write("Room Width in Feet? ");
        roomWidth = float.Parse(Console.ReadLine());
        Console.Write("Room Depth in Feet? ");
        roomDepth = float.Parse(Console.ReadLine());
        Console.Write("Room Height in Feet? ");
        roomHeight = float.Parse(Console.ReadLine());
        Console.WriteLine();
        Console.WriteLine("1 mil is 1/1000 of an inch");
        Console.Write("Paint Thickness in Mils? ");
        paintThickMil = float.Parse(Console.ReadLine());
        paintThick = paintThickMil / 1000;
        Console.WriteLine();
        Console.WriteLine("Calculating...");

        getLayers(roomWidth, roomDepth, roomHeight, paintThick);
        Console.ReadKey();
    }
}

I could ( probably ) not cast the (float) to each and every one of the math operations; would that still work?

also here's my github repo for this project to see the other various versions of this code https://github.com/Izder456/paintRoomCalc

  • Olvier Rogier, your help cleared up the casting an int. You helped that, thanks! So far i'm enjoying C#! – izder456 dev Sep 13 '20 at 20:00
  • Math.pow [certainly can do operations on doubles](https://learn.microsoft.com/en-us/dotnet/api/system.math.pow?view=netcore-3.1) - and it takes two arguments. The error you solved with the cast is that double to int is a narrowing conversion and is hence not allowed implicitly – Caius Jard Sep 14 '20 at 00:47

2 Answers2

1

To convert a string to int I'd use either var myInt = Convert.ToInt32("1234"), var myInt = int.Parse("1234"), or bool success = int.TryParse("1234", out int myInt) if I thought it might fail and I wanted to know if it did

int.ToString() is the opposite of what you say you want to do

JS is a lot more forgiving (unhelpfully so if you're porting over to c#) with its variable typing. In c# you decide what type a variable will be and you can't change it for the rest of its life, which is a scope like let. You'll struggle with your code as written because you're trying to assign different types to the same variable

No:

var x = 123; //x is an int forever
x = "234"; //can't assign string to int
x = int.Parse(x); //can't pass int x into Parse: string expected

Yes:

var x = 123;
var xStr = "234";
x = int.Parse(xStr);

It'll probably help you NOT to use var; JS uses var in a very different way to C#. Start out your C# life by being explicit:

int x = 123;
string xStr = "234";
x = int.Parse(xStr);

It will help you kick the JS var habit/help you psychologically divorce yourself from JS-ey var. In C# var is you saying that the compiler is allowed to work out the type of the variable when the program is compiled (which happens once) and set it for you. It is not some flexible "can change it anywhere and any time to anything you want global thing" like JS (because JS is "continually compiled" variables are allowed to change type - C# doesn't allow it).

it'd be good to kick var in JS too, but for different reasons (mostly you should use let for a variable you do change and const for a variable you don't)


int edgeArea, edgeSideDepthArea, edgeSideDepthVol, edgeSideWidthArea, edgeSideWidthVol, edgeUpArea, edgeUpVol, edgeVol, roomVol, wallArea, wallFive, wallOne, wallThree, wallVol;

Don't do this. In C# we declare our variables very close or at first use, not at the top of the method. A variable lives while the code is still within the { curly braces } scope that the variable was declared in

Don't write this:

public int MyMethod(){
{
  int result;
  ... 98 lines that don't use result at all ...
  result = x + y;
  return result;
}

Do write this:

public int MyMethod(){
{
  ... 98 lines that don't use result at all ...
  int result = x + y;
  return result;
}

Result is declared near to where it is used (line 99/100) not on line 1, then forgotten, then mentioned 4 screens later - lot of scrolling to see where it was defined


It will tidy up your code considerably if you create a method (function) that asks the user for input (as a string) and returns an int (only if it's valid):

private int AskInt(string question){
  while(true) {
    Console.Write(question);
    if(int.TryParse(Console.ReadLine(), out int x))
      return x;
  }
}

Have a go at creating the same for double. Use them like:

int paintMils = AskInt("Paint thickness in mils? ");

Console.WriteLine(("& " + Convert.ToString(t / 4800)) + " gallons of paint");

The succinct way to write this these days is:

Console.WriteLine($"& {t / 4800} gallons of paint");

They're the c# equivalent of JS template strings. It is the $ preceding the string " delimiter that makes it interpolated, and then you're either "in the string" or you're "in code" (if you opened a { and didn't close it yet)

C# is happy to concatenate strings together with ints; you don't need to convert something to a string before you concat another string onto it

The interpolated form also takes an optional formatter:

double d = 12.3;
string s = $"To 3 decimal places is {d:0.000}";

The 0.000 is a format specification

Caius Jard
  • 72,509
  • 5
  • 49
  • 80
  • i'm still unclear on what i have to change in my code. – izder456 dev Sep 13 '20 at 19:59
  • That statement doesn't really help me understand what further advice to give. – Caius Jard Sep 13 '20 at 20:08
  • i cleaned it up by declaring a new variable for the string and a new variable for int, for each of the problematic lines – izder456 dev Sep 13 '20 at 20:11
  • It'd clean it up a way more if you implement the AskInt advice :) – Caius Jard Sep 13 '20 at 20:15
  • what do you mean by "In C# we declare our variables very close or at first use, not at the top of the method."? – izder456 dev Sep 15 '20 at 04:25
  • If you have a function that is 100 lines long and you need to use a variable called `result` on the last line, we **don't** adopt a pattern of writing `int result` on line 1 of the function, make no mention of it again for 98 lines, then on line 99 `result = x + y` and line 100 `return result`. Instead we would, on line 99, say `int result = x + y` and line 100 say `return result`. The variable is declared close to where it is used. Your code declares a huge number of variables on line 1, some of them only being used for the first time more than a screen's height later. Keep it together – Caius Jard Sep 15 '20 at 05:31
  • (People would probably also advocate breaking a 100 line function into smaller blocks of well named functions - it makes the code more self documenting. I know I wrote "Str" on the end of some of my variables when describing the difference between ints and strings, but that too is something else we typically avoid (unless coding with UI controls). Adopting something like AskInt means you can forego having all these useless string variables lying around; AskInt gives you what you want (an int) and very quickly throws away the temporary string it had to use to garner the user input – Caius Jard Sep 15 '20 at 05:35
0

Console.ReadLine() returns a string that you can convert using int.Parse() or int.TryParse() or Convert.ToInt32().

Math.Pow() returns a double that you need to cast like (int)Math.Pow().

And to convert an int to string use value.ToString().

Here is the code corrected and sanitized, but I don't know if it works, I had checked nothing nor refactored but it compiles and runs.

Room Width in Feet? 2
Room Depth in Feet? 3
Room Height in Feet? 4

1 mil is 1/1000 of an inch
Paint Thickness in Mils? 20000

Calculating...
1 layers to fill your room with paint!!
& 1,43 gallons of paint
static public void GetLayers(int roomWidth, int roomDepth, int roomHeight, int paintThick)
{
  int edgeArea, edgeSideDepthArea, edgeSideDepthVol, edgeSideWidthArea, edgeSideWidthVol, edgeUpArea, edgeUpVol, edgeVol, roomVol, wallArea, wallFive, wallOne, wallThree, wallVol;
  double i = 0;
  double t = 0;
  roomWidth = roomWidth * 12;
  roomDepth = roomDepth * 12;
  roomHeight = roomHeight * 12;
  roomVol = roomWidth * roomDepth * roomHeight;
  while ( roomVol >= 0 )
  {
    wallOne = roomWidth * roomHeight;
    wallThree = roomDepth * roomHeight;
    wallFive = roomDepth * roomWidth;
    wallVol = ( ( wallOne * 2 ) + ( wallThree * 2 ) + wallFive ) * paintThick;
    wallArea = ( wallOne * 2 ) + ( wallThree * 2 ) + wallFive;
    roomWidth = roomWidth - ( paintThick * 2 );
    roomDepth = roomDepth - ( paintThick * 2 );
    roomHeight = roomHeight - ( paintThick * 2 );
    edgeUpVol = (int)( roomHeight * Math.Pow(paintThick, 2) );
    edgeUpVol = edgeUpVol * 2;
    edgeUpArea = roomHeight * paintThick;
    edgeUpVol = edgeUpArea * 2;
    edgeSideDepthVol = (int)( roomDepth * Math.Pow(paintThick, 2) );
    edgeSideDepthVol = edgeSideDepthVol * 2;
    edgeSideDepthArea = roomDepth * paintThick;
    edgeSideWidthVol = (int)( roomWidth * Math.Pow(paintThick, 2) );
    edgeSideWidthVol = edgeSideWidthVol * 2;
    edgeSideWidthArea = roomWidth * paintThick;
    edgeVol = edgeUpVol + edgeSideWidthVol + edgeSideDepthVol;
    edgeArea = edgeUpArea + edgeSideWidthArea + edgeSideDepthArea;
    roomVol = roomVol - wallVol - edgeVol;
    wallArea = wallArea - edgeArea;
    i += 1;
    t += wallArea;
  }
  Console.WriteLine(i + " layers to fill your room with paint!!");
  Console.WriteLine("& " + t / 4800 + " gallons of paint");
}

static public void Main(string[] args)
{
  int roomWidth, roomDepth, roomHeight, paintThickMil, paintThick;
  Console.WriteLine("Paint Layer Calculator");
  Console.WriteLine("by : Аїӡек Меѥҏ");
  Console.WriteLine();

  //get input for room dimentions
  Console.Write("Room Width in Feet? ");
  roomWidth = int.Parse(Console.ReadLine());
  Console.Write("Room Depth in Feet? ");
  roomDepth = int.Parse(Console.ReadLine());
  Console.Write("Room Height in Feet? ");
  roomHeight = int.Parse(Console.ReadLine());
  Console.WriteLine();
  Console.WriteLine("1 mil is 1/1000 of an inch");
  Console.Write("Paint Thickness in Mils? ");
  paintThickMil = int.Parse(Console.ReadLine());
  paintThick = paintThickMil / 1000;
  Console.WriteLine();
  Console.WriteLine("Calculating...");

  GetLayers(roomWidth, roomDepth, roomHeight, paintThick);
  Console.ReadKey();
}