7.11. (Part 3) Array Operations - Java

preview_player
Показать описание
Starting out with Java: From control structures through objects
Chapter 7
Programming Challenges

11. Array operations

Write a program with an array that is initialized with test data. Use any primitive data type of your choice. The program should also have the following methods:

• getTotal. This method should accept a one-dimensional array as its argument and return the total of the values in the array.
• getAverage. This method should accept a one-dimensional array as its argument and return the average of the values in the array.
• getHighest. This method should accept a one-dimensional array as its argument and return the highest value in the array.
• getLowest. This method should accept a one-dimensional array as its argument and return the lowest value in the array.

Demonstrate each of the methods in the program.

Gaddis, Tony. Starting Out with Java: From Control Structures through Objects (Page 491). Pearson Education. Kindle Edition.

Thanks 😊
Рекомендации по теме
Комментарии
Автор

thank you so much!! your videos are so helpful. Im taking this as a class, and I learn more from how you explain things rather than just reading the book. My prof doesnt lecture so this really helps me. THANK YOU!!!!

paigekaub
welcome to shbcf.ru