+ 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.

28th Oct 2017, 12:44 AM
Geena Nana
Geena Nana - avatar
8 Answers
+ 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.
28th Oct 2017, 1:01 AM
Rrestoring faith
Rrestoring faith - avatar
+ 2
28th Oct 2017, 1:32 AM
Daniel
Daniel - avatar
+ 2
Thank you! honestly anything that can give me points lol😜
28th Oct 2017, 1:33 AM
Geena Nana
Geena Nana - avatar
+ 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
28th Oct 2017, 2:47 AM
Geena Nana
Geena Nana - avatar
+ 1
the starter code looks like this https://code.sololearn.com/cRgud9j5isFf/?ref=app
28th Oct 2017, 12:46 AM
Geena Nana
Geena Nana - avatar