Space Age

in #ita4 months ago

class SpaceAge {

static double age(String planet, int seconds) {
    if(planet.equals("Mercury")) return Math.round(seconds /(0.2408467*31557600)*100)/100
    else if(planet.equals("Venus")) return Math.round(seconds /(0.61519726*31557600)*100)/100
    else if(planet.equals("Earth")) return Math.round(seconds /31557600 *100)/100
    else if(planet.equals("Mars")) return Math.round(seconds /(1.8808158*31557600) *100)/100
    else if(planet.equals("Jupiter")) return Math.round(seconds /(11.862615*31557600) *100)/100
    else if(planet.equals("Saturn")) return Math.round(seconds /(29.447498*31557600) *100)/100
    else if(planet.equals("Uranus")) return Math.round(seconds /(84.016846*31557600) *100)/100
    else return Math.round(seconds /(164.79132*31557600) *100)/100
}

}

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.