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 Output |
Click here to see other solutions to Introduction to Java Programming.