New to java just wondering if you guys could tell me if i did this problem correct?
So the question is:
curHour and curMin represent the current time, and depHour, depMin
represent the departure time of a bus. Suppose all these variables are
initialized with some values; both times are between 1 p.m. and 11 p.m of the
same day. Fill in the blanks in the following statements that display the
remaining waiting time in hours and minutes:
int ____________ =
___________________________________ ;
System.out.println( ______________________________ +
" hours and " + ______________________________ +
" minutes.");
My answer is:
int Waiting_Time= (depHour + depMin) - (curHour + curMin);
System.out.println("Waiting_Time=" + "hours and" + ___________+ "minutes.");
Im not sure how i would get the minutes here without declaring them before?