+ 1
Java practice 6.2 needs help.
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double pi = 3.14; //your code goes here System.out.println(scanner.nextLine()); String x = scanner.nextLine(); Sysem.out.println(2*x*pi); } } It doesn't work. Java 6.2 practice. I need to get perimeter.. This practice is way more difficult from what I learned from this app.
5 Respostas
+ 9
It's working fine here.
Check it again.
https://code.sololearn.com/cpvtep0K3Q8g/?ref=app
+ 2
Simba oh now it works. Scanner should have been lower case. 🤯 thank you for your help!
0
Can you please paste full description. because most of learner does not have pro version so we can not see what is problem statement.
0
Here is the description.
During your math class, you are given a task to calculate the perimeter of a circle.
You decide to write a small program that will take the radius as input, and will calculate and print the perimeter for you.
The value for π (pi) is already defined.
Sample Input
4
Sample Output
25.12
0
Simba it doesn't work unfortunately :/