+ 3
Can anyone help with my homework
Write a program that will calculate the sum of an array of numbers, find the smallest number, and find the largest number. make an int array from the args array. Write a method called sum that takes the int array as a parameter and calculates the sum. Write a method called smallest that takes the int array as a parameter and finds the smallest number. Write a method called largest that takes the int array as a parameter and finds the largest number.
5 ответов
+ 4
Summing the elements is taught in the course, have a look there for that (It is also very similar to finding max/min).
Finding the smallest or largest value can be done by going through each element in the array.
You can start by assuming the first element is the largest/smallest.
Then, checking to see if the next is larger/smaller than that. Keep checking, until you get through the entire array.
Once done that you will have the largest/smallest.
+ 2
https://code.sololearn.com/cx2754IczFR6/?ref=app
Maybe something like that ;-)
+ 2
Thank you! honestly anything that can give me points lol😜
+ 2
Thank you! I'm aware of the solo code playground☺
I am using a website called moodle that where i can use command line and it shows the output(srry lol idk the terminology) idk why I am taking the course lol i'm definitely not taking computer programming 11. We go by fast..i need time to understand programming but..it is a college course. never again haha lol @Martin Taylor
+ 1
the starter code looks like this
https://code.sololearn.com/cRgud9j5isFf/?ref=app