0% found this document useful (0 votes)
18 views4 pages

oop

Uploaded by

Grace May Romano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

oop

Uploaded by

Grace May Romano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Tuy, Sheena

Romano, Grace May


Pelicano,Marlyn
Leo Laureta
Ferrer, Krizttiane
Casanoden Fatima
Nalipay Gezyl
Alinog Bebe

3.
import java.util.Scanner;
public class number3 {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.print("Enter the first number: ");
double num1 = scan.nextDouble();
System.out.print("Enter the second number: ");
double num2 = scan.nextDouble();
scan.close();
System.out.print("Celcius Converted to Fahrenheit:" + (num1-9/5)+32 + "\r\n");
System.out.print("Fahrenheit Converted to Celcius:" + (num2-32)*5/9);
}
}
4.
import java.util.Scanner;
public class number4{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.print("Enter the first number: ");
double num1 = scan.nextDouble();
System.out.print("Enter the second number: ");
double num2 = scan.nextDouble();
System.out.print("Enter the third number: ");
double num3 = scan.nextDouble();
scan.close();
System.out.print("The average of entered numbers is:" + avr(num1, num2,
num3) );
}

public static double avr(double a, double b, double c, double d, double e)


{
return (a + b + c + d + e) / 5;
}
}
5.
import java.util.Scanner;
public class number5 {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.print("Enter Amount Peso : ");
double num1 = scan.nextDouble();
scan.close();
System.out.print("Your Peso Converted To Dollar : " + num1 * 43.25);
}
}
6.
import java.util.Scanner;
public class number6{

private static final double radius = 7.5,;

public static void main(String[] args) {

double perimeter = 2 * Math.PI * radius;


double area = Math.PI * radius * radius;

System.out.println("Perimeter is = " + perimeter);


System.out.println("Area is = " + area);
}
}

You might also like