Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studio 9 7 2023 menu #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
studio
  • Loading branch information
Rebecca Yeager authored and Rebecca Yeager committed Aug 22, 2023
commit f6f779ffdbd2409cd967efc8935d816d482faaba
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.launchcode;
import java.util.Scanner;

public class Area {
public static void main(String[] args){
double radius;
double area;
Scanner input;
input = new Scanner(System.in);
System.out.println("Enter a radius.");
radius = input.nextDouble();
input.close();
if (radius > 0) {
area = Circle.getArea(radius);
System.out.println("The area of the circle with radius " + radius + " is " + area);
} else {
System.out.println("Error");

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.launchcode;

public class Circle {
public static Double getArea(Double radius) {
return 3.14 * radius * radius;
}
}