Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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



Advertisement
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 Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com