76 393
Assignments Done
Successfully Done
In May 2019

Answer to Question #18527 in Java | JSP | JSF for Gjert

Question #18527
import java.util.Scanner;

class apples{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
System.out.println("Select one of the following (absolute,ceil,floor,max,min,power,squareroot): ");
String code = scan.nextLine();
if (code.contains("absolute"));
System.out.println("Enter a number to get absolute value: ");
double num1 = scan.nextDouble();


Hey, this is the question I have, I want to be able to output and/or input a decimal value, but I keep getting errors, how come?
Expert's answer
you should use comma when you enter data.
For example:
"1,2" - correct
"1.2" - not correct

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions