double value = 2.45;
double fraction=value%1; //remainder from mod%1 division leave everything after the decimal point
int integer=(int)value; //cast as int to keep everything before the decimal point
Catherine !ttGirlsPl2 (OP) replied with this 7 years ago, 21 minutes later, 44 minutes after the original post[^][v]#973,244
@previous (B) > Main.java:11: error: incompatible types: possible lossy conversion from double to int
Does repl.it not like this?
Anonymous B replied with this 7 years ago, 17 minutes later, 1 hour after the original post[^][v]#973,251
@previous (Catherine !ttGirlsPl2)
Oh, it's complaining about the cast. I'm not up on what Java complains about lately. Persnickety little machine. You should slap it around and tell it do what you say. Walk the cast through a float? Use Math.round()? I don't know. The integer bit should be the easiest part.
Anonymous C joined in and replied with this 7 years ago, 57 seconds later, 1 hour after the original post[^][v]#973,253
@973,244 (Catherine !ttGirlsPl2)
Do your own damned homework for your on line junior college math glass!
Anonymous D joined in and replied with this 7 years ago, 3 minutes later, 1 hour after the original post[^][v]#973,256