0% found this document useful (0 votes)
5 views6 pages

Arithmetic Operators

The document contains Java programs for converting temperatures between Fahrenheit and Celsius, calculating the area of a circle, triangle, and square. Each program prompts the user for necessary input and outputs the calculated area or converted temperature. The code is structured into separate classes for each geometric shape and temperature conversion.

Uploaded by

kowsikur2012
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)
5 views6 pages

Arithmetic Operators

The document contains Java programs for converting temperatures between Fahrenheit and Celsius, calculating the area of a circle, triangle, and square. Each program prompts the user for necessary input and outputs the calculated area or converted temperature. The code is structured into separate classes for each geometric shape and temperature conversion.

Uploaded by

kowsikur2012
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

F-C

package temperature;

import [Link];

public class Frenheittocelcius {

public static void main(String[] args) {

Scanner input= new Scanner ([Link]);

double Fahrenheit,Temp;

[Link]("Enter Fahrenheit:");

Fahrenheit = [Link]();

Temp = 0.5555555555*(Fahrenheit-32);

[Link]("Area of circle is:"+Temp);

}
C-F

package temperature;

import [Link];

public class CelciustoFarenheit {

public static void main(String[] args) {

Scanner input= new Scanner ([Link]);

double Celcius,Temp;

[Link]("Enter Celcius:");

Celcius = [Link]();

Temp = 1.8*Celcius+32;

[Link]("Area of circle is:"+Temp);

}
Circle

package newjavatask;

import [Link];

public class Circle {

public static void main(String[] args) {

Scanner input= new Scanner ([Link]);

double Area,Radius;

[Link]("Enter Radius:");

Radius = [Link]();

Area = 3.1416*Radius*Radius;

[Link]("Area of circle is:"+Area);

}
Triangle

package newjavatask;

import [Link];

public class Trainale {

public static void main(String[] args) {

Scanner input= new Scanner ([Link]);

double Land,Height,Area;

[Link]("Enter Land:");

Land = [Link]();

[Link]("Enter Height:");

Height = [Link]();

Area = 0.5 * Land * Height;

[Link]("Traingle is:"+Area);
}

Square

package newjavatask;

import [Link];

public class Square {

public static void main(String[] args) {

Scanner input= new Scanner ([Link]);

double Area,Side;

[Link]("Enter Side:");

Side = [Link]();

Area = Side*Side;

[Link]("Area of Square is:"+Area);


}

You might also like