Home Answers Viewqa Java-Interview-Questions why the occupancy rate is zero?

 
 


rayda
why the occupancy rate is zero?
1 Answer(s)      4 years and 3 months ago
Posted in : Java Interview Questions

View Answers

February 23, 2009 at 7:25 AM


Hello,

I go through your code and found that you have to alter your code like this "occupancyRate= (double)totalOccupied / totalRooms;".
If you not parse the multiplication result of totalOccupied and totalRooms then you will get the result 0.0 becouse these two variable is integer type.When ever you perform multiplication between two integer values then you will get result in integer form.









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.