+ 1

Why am I getting errors?

import java.util.Scanner; public class CalcCircumference { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Do you want to use Diameter of Radius?"); System.out.println("Enter your choice"); String choice = input.nextLine(); if(choice.equalsIgnoreCase("Diameter")) { System.out.println("Enter Diameter"); int diameter = input.nextInt(); double circum = Math.PI * diameter; System.out.println("Choice: Diameter"); System.out.println("Circumference = " + circum); } if(choice.equalsIgnoreCase("Radius")) { System.out.println("Enter Radius"); double radius = input.nextDouble(); double circum = Math.PI * Math.pow(radius, 2); System.out.println("Choice: Radius"); System.out.println("Circuference = " + circum); } } }

11th Jan 2017, 2:51 AM
Phoenix28
Phoenix28 - avatar
2 Respuestas
+ 1
error?
11th Jan 2017, 3:38 AM
Jobemar Arreaza
Jobemar Arreaza - avatar
0
whats the error given by compiler?
11th Jan 2017, 3:12 AM
Jonty Bamrah