1.2 KiB
1.2 KiB
Hints
General
1. Calculate the production rate per second
- Determining the success rate can be done through a conditional statement.
- Java allows for multiplication to be applied to two different number types (such as an
intand adouble). It will automatically return the "broader" data type. - Numbers can be compared using the built-in comparison and equality operators.
2. Calculate the number of working items produced per second
- Whereas an
intcan be automatically converted to adouble, the reverse does not hold. The reason for this is that aninthas less precision than adoubleso rounding has to be applied, also the range of numbers anintcan represent is smaller than adouble. To force this conversion you can use a cast to an int.