2 AnswersNew 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.