+ 1
Fix my java calculator
https://code.sololearn.com/cPV1bSdhvPTA/?ref=app import java.until.Scanner; class myclass{ public static void main(String []args){ Scanner Robin = new Scanner(System.in); double fnum, snum, answer; System.out.println("Enter the first number"); fnum = Robin.nextDouble(); System.out.println("Enter the second number"); snum = Robin.nextDouble(); answer = fnum + snum; System.out.println ("answer"); } } this is my.
7 Answers
+ 1
i fixed util byt wgat you mean wuth answer variable
+ 4
Hey, I think you want import java.util
not
until
You also want to print the variable answer and not the string "answer"
+ 3
When you run the program it prints the word answer, right? That is because it is enclosed in double quotation marks, if you remove them, you will see that an actual numerical answer is printed.
+ 3
what errors are you getting may I ask?
+ 3
its fixed topic closed i was only inputing 2.50 and waiting for next dialogue box. but when i wrote 2 values 2.50 3.50 in the first dialogue box my code works.
+ 1
done but still getting errors. removed the ""