Write a Java program that obtains products' numbers (array named products]), and allows the user to perform array's operations using the following methods: initializeArray( - to initialize the array's elements printArray()- to print array's elements searchArray()- to search and determine if a product exists in the array removeArray()- to remove an array element and display the new array The program also includes: 1. One class named ArrayOperations 2. One instance variable named size Your program should include the following code statements in the ArrayApp class: Please provide out put and screen for code AryOperations java 2"ArrayApp java 1 import javax.swing.J0ptionPane; 3 public class ArrayApp { public static void main(String[] args) ( Arryoperations obj = new Arryoperations(); obj.initializeArray(); obj.printArray(); int searcho = Integer parseInt (J0ptionPane.showInputoialog("Do you want to search for a product? 1- Yes, 2- No")); if (searcho 1) { obj.searchArray(); int RemoveQ = Integer -parseInt(J0ptionPane.showInputDialog("Do you want to remove a product from the list? 1- Yes, 2- No")); 1f (RemoveQ 1) { obj.removeArray(); 17 18 19 2e }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a Java program that obtains products' numbers (array named products]), and
allows the user to perform array's operations using the following methods:
initializeArray()
- to initialize the array's elements
printArray()- to print array's elements
searchArray()-to search and determine if a product exists in the array
removeArray()-to remove an array element and display the new array
The program also includes:
1. One class named ArrayOperations
2. One instance variable named size
Your program should include the following code statements in the ArrayApp class:
Please provide out put and screen for code
AryOperations java
import javax.swing.J0ptionPane;
2 "ArrayApp java E
3 public class ArrayApp {
public static void main(String[] args) {
Arryoperations obj = new Arryoperations ();
obj.initializeArray();
obj.printArray();
int searchQ = Integer
50
1e
parseInt (J0ptionPane.showInputDialog("Do you want to search for a product? 1- Yes, 2- No"));
if (searchQ - 1) {
obj.searchArray();
11
12
13
14
15
h6
17
18
19
2e }
int RemoveQ = Integer
-parseInt(J0ptionPane.showInputDialog("Do you want to remove a product from the 1ist? 1- Yes, 2- No"));
if (RemoveQ == 1) {
obj.removeArray();
A sample run is shown below.
Transcribed Image Text:Write a Java program that obtains products' numbers (array named products]), and allows the user to perform array's operations using the following methods: initializeArray() - to initialize the array's elements printArray()- to print array's elements searchArray()-to search and determine if a product exists in the array removeArray()-to remove an array element and display the new array The program also includes: 1. One class named ArrayOperations 2. One instance variable named size Your program should include the following code statements in the ArrayApp class: Please provide out put and screen for code AryOperations java import javax.swing.J0ptionPane; 2 "ArrayApp java E 3 public class ArrayApp { public static void main(String[] args) { Arryoperations obj = new Arryoperations (); obj.initializeArray(); obj.printArray(); int searchQ = Integer 50 1e parseInt (J0ptionPane.showInputDialog("Do you want to search for a product? 1- Yes, 2- No")); if (searchQ - 1) { obj.searchArray(); 11 12 13 14 15 h6 17 18 19 2e } int RemoveQ = Integer -parseInt(J0ptionPane.showInputDialog("Do you want to remove a product from the 1ist? 1- Yes, 2- No")); if (RemoveQ == 1) { obj.removeArray(); A sample run is shown below.
Expert Solution
steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY