File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
package binod ;
2
2
import java .util .Scanner ;
3
+
3
4
public class AreaSquare {
5
+ public static void printHelloWorld () {
6
+ System .out .println ("Hello World" );
7
+ }
8
+
9
+ public static double calculateSquare (double side ) {
10
+ double area = side * side ;
11
+ return area ;
12
+ }
13
+
4
14
public static void main (String [] args ) {
5
- Scanner scanner = new Scanner (System .in );
15
+ Scanner scanner = new Scanner (System .in );
6
16
System .out .println ("Enter side of a square" );
7
- double side =scanner .nextDouble ();
8
- double area =side *side ;
9
- System .out .println ("The area of square is: " +area );
17
+ double side = scanner .nextDouble ();
18
+ printHelloWorld ();
19
+ double area = calculateSquare (side );
20
+ System .out .println ("The area of square is: " + area );
10
21
}
11
22
}
You can’t perform that action at this time.
0 commit comments