Can someone help me with this JAVA question: | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

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)

26th Mar 2022, 7:35 PM
Ashley Norman
2 Answers
+ 2
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..
26th Mar 2022, 7:39 PM
Jayakrishna 🇮🇳
+ 2
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.
26th Mar 2022, 8:21 PM
Nick