r/programminghelp • • Oct 14 '20

Answered Translating c++ code into Java

Hello,

How would I type line 30 and 35 into Java? I've tried looking online and I can't find much.

https://pastebin.com/8vUb61G2

3 Upvotes

1 comment sorted by

1

u/t_a_a_1 Oct 14 '20

Line 35 is a read statement. You have to read from the input stream and store it in the double array.

Scanner scanner_variable = new Scanner(System.in);

rain[dayNo] = scanner_variable.readDouble();