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

Question

Write a program with a main() method that asks the user to input an integer array of 10 elements.
Next, create three methods described below. From inside your main() method, call each of the
three methods described below and print out the results of the methods 2, 3, which return values.

1. printReverse() - a method that receives an array of integers, then reverses the elements of
the array and prints out all the elements from inside the method. Print all in one line
separated by commas (see sample output below). Do not print the ‘trailing’ comma!!
2. getLargest() – a method that receives an array of integers, then returns the largest integer
value in the array. Return largest integer and print from main(), not method.
3. computeTwice()- a method that receives the previously reversed array of integers, then
returns an array of integers which doubles the value of each number in the array (see the
sample output below). Return new array of integers print from main(), not method
EXAMPLE OUTPUT:
Enter a number:
22
Enter a number:
34
Enter a number:
21
Enter a number:
35
Enter a number:
12
Enter a number:
4
Enter a number:
2
Enter a number:
3
Enter a number:
99
Enter a number:
81
Here the array in reverse: 81, 99, 3, 2, 4, 12, 35, 21, 34, 22
The highest valued element: 99
The array with two times each element: [162, 198, 6, 4, 8, 24, 70, 42, 68, 44]

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
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