Java practice 6.2 needs help. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 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.

4th Jun 2021, 7:29 AM
Jay Kay
5 Respuestas
+ 9
It's working fine here. Check it again. https://code.sololearn.com/cpvtep0K3Q8g/?ref=app
4th Jun 2021, 10:50 AM
Simba
Simba - avatar
+ 2
Simba oh now it works. Scanner should have been lower case. 🤯 thank you for your help!
4th Jun 2021, 10:58 AM
Jay Kay
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.
4th Jun 2021, 7:53 AM
Java Developer
Java Developer - avatar
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
4th Jun 2021, 7:59 AM
Jay Kay
0
Simba it doesn't work unfortunately :/
4th Jun 2021, 10:44 AM
Jay Kay