File Name: ArrayOperations.java Class Name: ArrayOperations Problem Description: Write a program to perform the following operations on an array: 1. Initialize integer arrays with input values 2. Print array 3. Search a number and return its index if it is present otherwise return -1 4. Find the smallest odd number from the array 5. Exit Note: To find the smallest number, it is required initialize the smallest number variable to the larger number which is not present in the array. You can initialize the smallest number to Integer.MAX_VALUE; Guidelines: 1. Use switch case and while loop. 2. Variables to declare in main method- An array of integer datatype 3. Use methods to write each operation listed in problem description and pass array as an argument to all methods. Steps to follow: 1. Declare anarray of size 5 2. Display array operations 3. Input user choice 4. Use the switch case to call the appropriate method 4. Implement the methods in your program for all operations listed in the problem description 5. Loop again to display array operations. Provide and exit the loop (hint: use return statement) Operations 1. Initialize Array 2. Print Array 3. Search a number 4. Find smallest odd number 5. Exit Enter your choice: 1 Enter the array values: 11 12 13 14 15 Operations 1. Initialize Array 2. Print Array 3. Search a number 4. Find the smallest odd number 5. Exit Enter your choice: 2 Array - 11 12 13 14 15 Operations 1. Initialize Array 2. Print Array 3. Search a number 4. Find the smallest odd number 5. Exit Enter your choice: 3
File Name: ArrayOperations.java Class Name: ArrayOperations Problem Description: Write a program to perform the following operations on an array: 1. Initialize integer arrays with input values 2. Print array 3. Search a number and return its index if it is present otherwise return -1 4. Find the smallest odd number from the array 5. Exit Note: To find the smallest number, it is required initialize the smallest number variable to the larger number which is not present in the array. You can initialize the smallest number to Integer.MAX_VALUE; Guidelines: 1. Use switch case and while loop. 2. Variables to declare in main method- An array of integer datatype 3. Use methods to write each operation listed in problem description and pass array as an argument to all methods. Steps to follow: 1. Declare anarray of size 5 2. Display array operations 3. Input user choice 4. Use the switch case to call the appropriate method 4. Implement the methods in your program for all operations listed in the problem description 5. Loop again to display array operations. Provide and exit the loop (hint: use return statement) Operations 1. Initialize Array 2. Print Array 3. Search a number 4. Find smallest odd number 5. Exit Enter your choice: 1 Enter the array values: 11 12 13 14 15 Operations 1. Initialize Array 2. Print Array 3. Search a number 4. Find the smallest odd number 5. Exit Enter your choice: 2 Array - 11 12 13 14 15 Operations 1. Initialize Array 2. Print Array 3. Search a number 4. Find the smallest odd number 5. Exit Enter your choice: 3
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Please use Java
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 now
This is a popular solution!
Step by step
Solved in 3 steps with 7 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.Recommended textbooks for you
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
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