This is my code. I want to compare within morning,afternoon and evening. can I do like this? private String interpretFT(int morninghour, int afternoonhour, int eveninghour) { if (morninghour > afternoonhour ) { return "Time to exercise : Morning"; } else if (afternoonhour > eveninghour) { return "Time to exercise : Afternoon"; } else if (eveninghour > morninghour) { return "Time to exercise : Evening"; } else { return "Please have the freetime to have some exercise"; } }
Aucun commentaire:
Enregistrer un commentaire