Warnings pop up during compile. Compile succeeds but won't execute at all
warning C4305: '=' : truncation from 'double' to 'float' <-- shows up 4 times
warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
I don't get why your function 'bf' is of type float. All calculations involved are of type int, so when you return it you're just returning a float that will never have anything past the decimal point; basically an int.
function bf should return a float since on line 95 you divide by 12.0.
This will most likely give you a float.
Try putting an F after a number to declare it as a float instead of double, like this:
squareFeet = (length * width) / 12.0F;
aside from that, warnings shouldn't keep your program from executing. This code should work, with or without warnings.
warnings that output when compiled...What is going on here it repeats for lines: 44, 47,50, 54, 58 warning C4305: '=' : truncation from 'double' to 'float'
Take for example Line 44: float lcost = 1.09
because when you write a value literal like 1.09 in a program it is a double.
a double has more decimal places than a float so you will loose precision if you force it into a float.
You should do it like this: float lcost = 1.09f Notice the f at the end of the number so signify float.