Can someone help me with this JAVA question: | Sololearn: Learn to code for FREE!


Can someone help me with this JAVA question:

Write a method that computes the sum of 1 through n then returns the average (This is a question from one of my classes that i need help with)

3/26/2022 7:35:26 PM

Ashley Norman

2 Answers

New Answer


Try yourself first and post your attempt. Before trying complete the lessons first. Atleast for this task, lessons of variable, loop, arithmetic operations.. Hope it helps..


You need to calmly analyze what you need. You need to know how method looks like. How to pass an argument to it. What do you use to cycle through numbers one by one. What arhitmetic operation you need to perform on those numbers. These things are explained sufficiently in the java course on sololearn. Don’t rush it, don’t skip fudamentals. It will work only if you let yourself figure it out on your own. Yes, you will make mistakes, but don’t be afraid of them. Post your attempt if ots not working and you’re seriously stuck. Good luck my friend.