- 1

Double method Can't return decimal or rational values.

I wrote this code. But double method doesn't return any thing. I wrote this code in eclipse static double PSCH(int a,int b){ int v = a-b; double d = Math.abs(v/a); return d; } Codes: https://code.sololearn.com/cCli9sB7oS7x/?ref=app Type this in Scanner : 3800 1200000 1200000 20 4800

30th Mar 2018, 6:31 PM
Salim13i
Salim13i - avatar
3 Réponses
+ 5
I don't know Java so well, but if we want to see the result of PSCH(R_Ly,R_Ty); shouldn't we write: System.out.println(PSCH(R_Ly,R_Ty)); I only see PSCH(R_Ly,R_Ty); What program is this anyway?
30th Mar 2018, 9:10 PM
Ipang
+ 2
you should print it: System.out.println(PSCH(R_Ly,R_Ty));
30th Mar 2018, 8:37 PM
🇮🇷 M N
0
Result in eclipse is : write last year usd price in rial : 3800 write last years salary : 1200000 last year salary in usd is : 315 write current salary :1200000 write percentage of salary increment : 20 write current usd price : 4800 salary change of 20 percent in usd is : 50 current salary in usd : 250 salary change in USD after adding increment is : 300 percentage of salary changes is : 🔹This line(last) related to that double method code : 👉🏿 percentage of salary changes is :
30th Mar 2018, 6:39 PM
Salim13i
Salim13i - avatar