Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java programming 1. Input 10 integers from the keyboard and store them into an array, write a program to satisfy the following requirements: (10') (1).

java programming
image text in transcribed
1. Input 10 integers from the keyboard and store them into an array, write a program to satisfy the following requirements: (10') (1). Provide a Mathematics Class which has 3 static methods: (5') I. Prototype: public static int add(int// array) Sum the items in an array, and the return keeps the result. II. Prototype: public static void sortArray(int// array, boolean flag) Sort the items in an array by the flag: if the flag is true, sort the array in an ascending order; if the flag is false, sort the array in a descending order. III. Prototype: public static void printArray(int// array, boolean flag) Print the items in an array by the flag: if the flag is true, print the items in the array in a positive sequence; if the flag is false, print the items in the array in a reverse order. (2). Output the data in the array in the reverse order; (1') (3). Sort the data in the array in the ascending order; (1') (4). Calculate the sum and the average of these integers. (1') (5). Requirements of (2) (4) must use the static methods defined in class Mathematics to demonstrate their functions. (2')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago