What's new

# Java Need help with something for school

Z

#### Zuke

##### Curb Appeal.
question 3 is write a program that will calculate the the area of a square and a circle displayed to two decimal places (so use the double variable) how do i go about doing this ? I missed the week we were doing it in school so I'm clueless. Any help GREATLY appreciated

X

#### Xeren

##### ♦♦♦ God Complex ♦♦♦
question 3 is write a program that will calculate the the area of a square and a circle displayed to two decimal places (so use the double variable) how do i go about doing this ? I missed the week we were doing it in school so I'm clueless. Any help GREATLY appreciated
Area of a Square: sqrt(lengthOfSide)

X

#### XKLUTCHIN OUTX

##### Enthusiast
Ok so the only reason I'm just giving it to you is because I'm just learning to write in java, but I ended up with this

Code:
``````import java.util.*;
import java.text.*;
public class XKLUTCHIN_OUTX {

public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("###,##0.00");
Scanner Input = new Scanner(System.in);
System.out.println("Enter side length: ");
sideLength = Input.nextDouble();

}

}``````

Z

#### Zuke

##### Curb Appeal.
Ok so the only reason I'm just giving it to you is because I'm just learning to write in java, but I ended up with this

Code:
``````import java.util.*;
import java.text.*;
public class XKLUTCHIN_OUTX {

public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("###,##0.00");
Scanner Input = new Scanner(System.in);
System.out.println("Enter side length: ");
sideLength = Input.nextDouble();

}

}``````
Area of a Square: sqrt(lengthOfSide)
Thanks guys !

L

#### LawlessBaron

##### A myth
Retired
question 3 is write a program that will calculate the the area of a square and a circle displayed to two decimal places (so use the double variable) how do i go about doing this ? I missed the week we were doing it in school so I'm clueless. Any help GREATLY appreciated
I might have deleted my old source code but i may have it around for a assessment that was similar to this

Z

#### Zuke

##### Curb Appeal.
I might have deleted my old source code but i may have it around for a assessment that was similar to this
I finished it all up yesterday, it wasn't actually about the code but your comments flow cart and notes.

L

Retired
ah i see

U

#### uid0

##### Programming Guru
Ok so the only reason I'm just giving it to you is because I'm just learning to write in java, but I ended up with this

Code:
``````import java.util.*;
import java.text.*;
public class XKLUTCHIN_OUTX {

public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("###,##0.00");
Scanner Input = new Scanner(System.in);
System.out.println("Enter side length: ");
sideLength = Input.nextDouble();