writer a Java program to find area perimeter and daigonal of square if the side of the square is passed as parameter
Answers
Answered by
0
Answer:
computer system is the side of the Square is passed as parameter
Answered by
0
Explanation:
Program 1:
/**
* @author: name
* @description: Program to Calculate Area of square.Program
* will prompt user for entering the side of the square.
*/
import java.util.Scanner;
class SquareAreaDemo {
public static void main (String[] args)
{
System.out.println("Enter Side of Square:");
//Capture the user's input
Scanner scanner = new Scanner(System.in);
//Storing the captured value in a variable
double side = scanner.nextDouble();
//Area of Square = side*side
double area = side*side;
System.out.println("Area of Square is: "+area);
}
}
Output:
Enter Side of Square:
2.5
Area of Square is: 6.25
Similar questions