+ 1
Why my code not showing the desired output?
The program calculates years, months and days on the basis of number of days provided by the user as input. The code is running in BlueJ not in Solo learn Code Playground. Please Help me. https://code.sololearn.com/cRRXqgsgTjnr/?ref=app
6 Respostas
+ 4
At first sight it seems to me that the calculations are wrong. One year has 365 or 366 days not 360. Also the month has variable length between 28 and 31 days, but not fixed length of 30. Instead you can use date and time classes to perform the calculations. You can find more info about the classes here https://docs.oracle.com/javase/tutorial/datetime/iso/datetime.html.
+ 3
you can also try with InputStreamReader and BufferedReader
+ 3
You can find here an useful code by Marianna
https://code.sololearn.com/crH9ppu9W940/?ref=app
+ 2
It seems DataInputStream isn't available here in SoloLearn Code Playground, not sure why, but switching to use Scanner helped the code to run. As for the calculation, I'd probably take D⚽⚽⚽⚽7⃣7⃣7⃣ input with date & time.
+ 1
Still same wrong output
0
I don't know InputStreamReader and BufferedReader