Weeks to Days
Easyjava
Declare final int DAYS_PER_WEEK = 7; and use it to convert weeks into days.
Input: one whole number — the number of weeks.
Output: one line — the number of days.
Example 1
Input
3
Output
21
- 0 <= weeks <= 1000000
Hint 1
Multiply the input by the constant.
Hint 2
Using the named constant makes the formula self-explanatory.
The number 7 is fixed, so naming it DAYSPERWEEK with final documents the code and prevents accidental change. The conversion is a single multiplication.