Computer Science, asked by sreejachackraborty, 9 months ago

guys plz do .. it .. plz plz ... do any 2 of the following except 19 ,20 and 21... plz
. I will make you brainlist if ypu answer correctly .. no scam otherwise you will be reported​

Attachments:

Answers

Answered by anandkumar4549
2

22)

import java.util.Scanner;

public class Geometry

{

public static void main(String args[])

{

Scanner s=new Scanner(System.in);

System.out.println("MENU:");

System.out.println("Enter c for Area of a Circle");

System.out.println("Enter s for Area of a Square");

System.out.println("Enter r for Area of a Rectangle");

char op=s.next(). charAt (0);

switch(op)

{

case 'c': System.out.println("Enter radius:");

float r=s.nextFloat();

float ac=3.14f*r*r;

System.out.println("Area:"+ac);

break;

case 's': System.out.println("Enter side:");

int x=s.nextInt();

int as=x*x;

System.out.println("Area:"+as);

break;

case 'r': System.out.println("Enter height and base:");

float h=s.nextFloat();

float bs=s.nextFloat();

float art=0.5f*h*bs;

System.out.println("Area:"+art);

break;

default: System.out.println("Wrong choice");

}

}

}

23)

package com.java2novice.math;

public class MyLogEx {

public static void main(String a[]){

System.out.println("Natural logarithm value of 2 is: "+Math.log(2));

System.out.println("Natural logarithm value of 10 is: "+Math.log(10));

System.out.println("Natural logarithm value of 15 is: "+Math.log(15));

}

}

Output:

Natural logarithm value of 2 is: 0.6931471805599453

Natural logarithm value of 10 is: 2.302585092994046

Natural logarithm value of 15 is: 2.70805020110221

Answered by vaishnavisinghscpl45
0

Answer to your question

Attachments:
Similar questions