Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: BSD License 

public class Main {
    public static String humanizeTimeSpan(int minutes) {
        if (minutes < 30) {
            return Integer.toString(minutes) + " minutes";
        } else if (minutes < 45) {
            return "half an hour";
        } else if (minutes < 60) {
            return "45 minutes";
        } else if (minutes < 85) {
            return "an hour";
        } else if (minutes < 110) {
            return "an hour and a half";
        } else if (minutes < 24 * 60) {
            return Integer.toString((minutes + 10) / 60) + " hours";
        } else {
            return Integer.toString(minutes / (60 * 24)) + " days";
        }
    }
}