thank you soooo much!! i changed total2 to a double instead of an int and now the cast works correctly! nd my exercise is finished now thanks to you
heres the small change:
public class...
Type: Posts; User: fartofagony
thank you soooo much!! i changed total2 to a double instead of an int and now the cast works correctly! nd my exercise is finished now thanks to you
heres the small change:
public class...
it will calculate the averege (if thats what its called in english) of the 3 intergers the user inputs
when i make the program in c++ language it seems fine to cast and when i do it in java the way...
im using eclipse
oh i forgot to mention that the Keyboard class should be working correctly they instructed me to use it instead of Scanner to get user input
nope not from the book just tried to...
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from double to int
at Ex21.main(Ex21.java:8)
i think so yeah im learning java too but his question seemed a little different:D
do you know how to solve it?
public class Ex21{
public static void main(String args[]){
int num1, num2, num3, total1, total2;
num1 = Keyboard.readInt();
num2 = Keyboard.readInt();
num3 = Keyboard.readInt();...