Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9ab71ec

Browse files
Land Calculation
1 parent 53ce6c0 commit 9ab71ec

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
One acre of land is equivalent to 43,560 square feet.
3+
Write a program that calculates the number of acres in a tract of land with 389,767 square feet.
4+
Hint: Divide the size of the tract of land by the size of an acre to get the number of acres.
5+
*/
6+
7+
package com.challenges;
8+
9+
public class LandCalculation {
10+
public static void main(String [] args) {
11+
12+
// Declare Variables
13+
final double oneAcre = 43560; // square feer
14+
double givenSize = 389767; // in square feet
15+
double numberOfAcres;
16+
17+
numberOfAcres = givenSize / oneAcre;
18+
System.out.print(numberOfAcres + " acres");
19+
}
20+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /