
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question

Transcribed Image Text:v Question Completion Status:
Attach File
Browse My Computer
QUESTION 2
Write a Java program that creates an array of input n (get the input from the user) random integer numbers between 10 and 79
inclusive, and pass the array to a method named countAboveAverage that return integer. In this method, count the array
elements that are above or equal to average and return the count. Display the returned count in main method. Finally
print the n random numbers, Average, Above or equal to Average count and Below Average count. (use formula: n-
countAboveAverage)
Here is a sample run:
Enter the value of n:
10
Random numbers: 11 20
31
10
19 79
71
51 33 41
Average : 36.6
Above or equal to Average : 4
Below Average : 6
Attach File
Browse My Computer
Activate Win
Savo All Answors
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- JAVAarrow_forwardA void method creates an integer array of size 12. The method then ask user to input these 12 numbers and store them in the array. Then print out all the numbers that are multiples of 3 and then print out all the numbers that are multiples of 4. Example: Input a number (1/12): 3 Input a number (2/12): 5 Input a number (3/12): 7 Input a number (4/12): 8 Input a number (5/12): 2 Input a number (6/12): 3 Input a number (7/12): 10 Input a number (8/12): 6 Input a number (9/12): 2 Input a number (10/12): 7 Input a number (11/12): 12 Input a number (12/12): 9 The multiples of 3 are: 3, 3, 6, 12, 9 The multiples of 4 are: 8, 12arrow_forwardWrite a program named GradeStats.java then implement the following method: public static int[] gradeStats(int[] arr) It accepts int array representing test grades for CISY432 then calculates and returns the following grade statictics: highest, lowest, average, number of grades that are greater than or equal to 70, the number of grades that are less than 70 It returns these five numbers as an int array, and the 1st element is for highest, 2nd for lowest, 3rd for average 4th element for number of grades that are greater than or equal to 70 5th for the number of grades that are less than 70 For example. O Type here to search DELLarrow_forward
- in javaarrow_forwardCreate an int array of 10 elements. Assign each element a random integer between 0 and 99. Print out the average of this array. Hint: use the following code to generate random number import java.util.Random; Random rand = new Random(); int n = rand.nextInt(100);arrow_forwardJava - Sort an Arrayarrow_forward
- write the java programarrow_forwardA method named getUserStringsAndPopulate Array(). This method should keep prompting the user to enter as many strings as the user wants. The user should be able to stop entering strings by entering EXIT. This method should take the strings entered by the user and populate a one-dimensional array of strings with the user input. The string EXIT should NOT be added to the array because it is a special flag that will tell the method to stop prompting the user to enter more strings. This method should return the one-dimensional array of strings populated with user input and should not accept any arguments. 2.b) A method named searchArray() that would accept a one-dimensional array of strings and search the array for the string Winter. The search logic should NOT be case sensitive. If a match is found, this method should print the string in the array followed by a message like " --- Found a match!". Otherwise, the method should not print anything. This method should NOT return anything.…arrow_forwardIn JAVA Write the method below: Given a two-dimensional array containing integers, create a method called "matrixOperations" The method should do the following:1. Print out all the numbers in the array row by row (add empty line at the end of the row)2. For each row, print out the length of the row (each row is an array, remember)arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education