If you like having the latest and greatest laptop, then refurbished is not for you. However, if you don’t mind…
When you connect to the internet you can harm your PC. That is a fact. The reason antivirus software and…
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> * Exercise 1.12 - Average Speed In Kilometers<br /> *<br /> */ <br /><br />public class Ex1_12 {<br /> public static void main(String[] args) {<br /> System.out.println("Distance = 24 miles =" + (24.0 * 1.6) + " kilometersn");<br /> System.out.println("Time = 1 hour 40 minutes 35 seconds" + " = "<br /> + (1 + (((40.0 * 60.0) + 35.0) / 3600)) + " hours.n");<br /> System.out.print("Average Speed In kilometers per hour = ");<br /> System.out.println(((24.0 * 1.6) / (1 + (((40.0 * 60.0) + 35.0) / 3600)))<br /> + " kph.");<br /> }<br />} |
Program OutputClick here to see other solutions to Introduction to Java Programming.
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 OutputClick here to see other solutions to Introduction to Java Programming.
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> * Exercise 1.9 - Area And Perimeter Of A Rectangle<br /> *<br /> */ <br /><br />public class Ex1_09 {<br /> public static void main(String[] args) {<br /> System.out.println("Width = 4.5 nHeight = 7.9");<br /> System.out.println("Area = width x height = " + 4.5 * 7.9);<br /> System.out.println("Perimeter = 2 x (width + height) =" + 2 * (4.5 + 7.9));<br /> }<br />} |
Program OutputClick here to see other solutions to Introduction to Java Programming.