This compiles just fine in DEV C++ but in Microsoft Visual Studio it tells me that "finally is uninitialized", but it is initialized. So I'm not sure what to do to fix it so it will work in Visual Studio. Could anyone help me out?
Don't blame the compiler. You should as a matter of routine make sure that all variables are initialised before you try to make use of their existing value.
Actually you compiler is doing you a big favor not being "dumb".
Also I have a feeling you are using Bloodshed Dev C++ which comes with a compiler that hasn't been updated for what 8 years now? So that is probably why the compiler doesn't complain because it is almost a decade old and is no where near standard compliant ;p
Note, the compiler issues a warning. Depending on the configuration, the program may still execute with warnings present, though it is good practice to correct the code so there are no warnings.
...\Untitled8.cpp In function 'float totalhours(float)':
9 22 ...\Untitled8.cpp
[Warning] 'finally' is used uninitialized in this function [-Wuninitialized]