Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Java beginner, help please
First off, im a beginner at Java. Im taking a class where we are currently learning about If-statements and While-statements, and theyre tripping me up a little bit. Any help would be appreciated.
Here is the desired output for what were doing...
Enter 10 whole numbers: 0 2 -10 21 0 8 -5 5 -3 -2
Sum of the positive numbers: 36
Sum of the negative numbers: -20
Sum of all the numbers: 16
Probably simple stuff for you guys, but heres whats causing me problems...We need to input the "10 whole numbers" after running the program, but I dont know how I can put just 10 numbers and have the program go to the next step, which is finding the sum.
Currently, there is no limit to the numbers I can put in there. I think I have a decent understanding of if statements, so I believe I can figure out the rest once I can just get how to put in just 10 numbers and have the program continue.
Thanks in an advance to anyone who can help me out a little bit.
0 · ·