Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

In java

[画像:you will create one class named ArrayFun.java which will contain a main method and 4 static methods that will be called from the main method. The process for your main method will be as follows: Declare and create a Scanner object to read from the keyboard Declare and create an array that will hold up to 100 integers Declare a variable to keep track of the number of integers currently in the array Call the fillArray method described below, passing the appropriate arguments and storing the result in the appropriate variable. Call the computeProduct method described below, passing the appropriate arguments, and print the result to the screen with an appropriate label Ask the user for an integer and store in a variable named factor Use the countMultiples method described below to compute the number of multiples of that factor and print the result with an appropriate label Use the printArray method to print out the values in the array fillArray The static fillArray method will accept two parameters: an integer array and a Scanner. It must ask the user for values to add to the array, beginning at index 0, stopping when the user enters -999. Make sure that the -999 is not included in the array. The method will return the number of values put into the array. computeProduct The static compute Product method will accept two parameters: an integer array and an integer representing the number of valid values in the array. The method will return the product of the integers in the array. Note: test this with relatively small values or short arrays. 1 count Multiples The static count Multiples method will accept three parameters: an integer array, an integer representing the number of valid values in the array, and an integer representing a factor. The method will count the number of valid values in the array that are multiples of the factor and will return the count. printArray The static printArray method will accept two parameters: an integer array and an integer representing the number of valid values in the array. The method will print the valid values from the array to the screen, one per line.]
expand button
Transcribed Image Text:you will create one class named ArrayFun.java which will contain a main method and 4 static methods that will be called from the main method. The process for your main method will be as follows: Declare and create a Scanner object to read from the keyboard Declare and create an array that will hold up to 100 integers Declare a variable to keep track of the number of integers currently in the array Call the fillArray method described below, passing the appropriate arguments and storing the result in the appropriate variable. Call the computeProduct method described below, passing the appropriate arguments, and print the result to the screen with an appropriate label Ask the user for an integer and store in a variable named factor Use the countMultiples method described below to compute the number of multiples of that factor and print the result with an appropriate label Use the printArray method to print out the values in the array fillArray The static fillArray method will accept two parameters: an integer array and a Scanner. It must ask the user for values to add to the array, beginning at index 0, stopping when the user enters -999. Make sure that the -999 is not included in the array. The method will return the number of values put into the array. computeProduct The static compute Product method will accept two parameters: an integer array and an integer representing the number of valid values in the array. The method will return the product of the integers in the array. Note: test this with relatively small values or short arrays. 1 count Multiples The static count Multiples method will accept three parameters: an integer array, an integer representing the number of valid values in the array, and an integer representing a factor. The method will count the number of valid values in the array that are multiples of the factor and will return the count. printArray The static printArray method will accept two parameters: an integer array and an integer representing the number of valid values in the array. The method will print the valid values from the array to the screen, one per line.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
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.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education