1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> * Exercise 1.10 - Average Speed In Miles<br /> *<br /> */ <br /><br />public class Ex1_10 {<br /> public static void main(String[] args) {<br /> System.out.println("Distance = 14km nTime = 45 minutes 30 seconds = (45 x 60) + 30 n"<br /> + " -------------- hours n"<br /> + " 3600 n"<br /> + "1 mile = 1.6 kilometers. nAverage Speed in miles per hour = "<br /> + (14.0 / 1.6)/ (((45.0 * 60.0) + 30.0) / 3600) + " mph.");<br /> }<br />} |
Program Output |
Click here to see other solutions to Introduction to Java Programming.