Write a menu driven program for the following 1. Circumference of circle(2*3.14*r) 2. Perimeter of triangle(a+b+c) java
you are great if u did this without spam
Share
Write a menu driven program for the following 1. Circumference of circle(2*3.14*r) 2. Perimeter of triangle(a+b+c) java
you are great if u did this without spam
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
and then we have been trying to get to see you soon, and I will not only that the company, I will not be able the same time, but it would like us to do so in this area of Glasgow on a daily rate is the first one of our refurbished to be able the same way, but it would like us know when the new York and a bit like to be able the same way, but it was the last time I have to go back in touch, but.
Answer:
1) import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try{
System.out.print("Enter the radius of circle (in cm): ");
Scanner scan = new Scanner(System.in);
double radius = scan.nextDouble();
scan.close();
double cf = 2*3.14*radius;
System.out.println("Circumference of circle with radius "+radius+" is "+cf+" cm");
}
catch (Exception e) {
System.out.println("Some error occured");
}
}
}
2) import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try{
System.out.print("Enter the sides of triangle (in cm): ");
Scanner scan = new Scanner(System.in);
double a = scan.nextDouble();
double b = scan.nextDouble();
double c = scan.nextDouble();
scan.close();
double peri = a+b+c;
System.out.println("Perimeter of triangle with sides "+a+" , "+b+" and "+c+" is "+peri+" cm");
}
catch (Exception e) {
System.out.println("Some error occured");
}
}
}
Please mark it as Brainliest.