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
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
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...
Related questions
Question
Please help me as soon as possible
![AnayApp t ve eplanon Cu pnApoohol AayAop oa Appiration C hhpoalginndema r osle
Write a Java program that obtains products' numbers (array named productsI), 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:
ArnyOperations java a "Anayop java
inport javax. sking. J0ptionPane,
3 public class ArrayApp (
public static void main(String(1 args) {
Arryoperations obj - new Arryoperations();
obj.initializeArray();
obj.printárray();
int searcho - Integer
19
he
hi
porseint (J0ptionPane, showImputDialog( "Do you want to search for a product? 1- Yes, 2- No")):
if (searcho 1) {
obj. searcharray():
12
h4
int Ramoveg - Integer
porseint(30ptionPane. showInputoialog("Do you want to remove a product from the list? 1- Yes, 2- No"));
if (Removeg 1) (
obj.renovearray();
hs
A sample run is shown below.
Problems lavadoc Ducleration Corsole
Problens Javaduc Declo alkon OCusole
Arayhpp (1) (leva Applieation Carhpl.pponhplugi Amypn ( ava Application CersholnzpoehghigrayApy (1) ave Apslikatiun Crstipkpzpoule
EPrablems vadne Decltion Console
Irout
Inpul
Inpit
? Enter product 1 number?
2102
? How many products you store includes
Enter product o number?
1120
Cancel
OK Cancel
OK
Cancel
OK
Problemsvadne Declaration Conscle
Problems lavadee Declieton contole
AroblameiovadocDedaratios concolo
Producte uer 120
Product 1 ben 21ez
Product 2 ueber 31es
Product murber 201
Input
Input
Enter product 2 number?
Int
3109
2 Enter product 3 mumber?
9201
? De yo wa to saarah nor a preY 1 Yes, a.
Cancel
OK
ок
On Cana
Cancel
Prula Jaradue 6 Dedareet DCuol
AnayAnp 1 lava Appkanon C npoonplAayAnp ) fawa Appiration Cuehhepoahphi iyoe ktlCl apoolglagieagockpjujuper
Products List
Product e number: 1120
Product i number: 2182
Product 2 number 3i09
Product 3 number: 9201
Bobieralevodes Dlarelior. OCorsule
rohiees Idar eon Console
Preducts st:
Product e nunber: 1120
Product 1 nunber: 2102
Product 2 nunber: ze0
Product a munber 901
Producta Liat:
Product e nunber: 112
Product 1 nunber 2102
Product 2 nunter 11e
Procuct nunber; 1201
Input
Meccage
which product you want to display
2 Do voe want to ramovea product tro the lat 1-Ye, 2-No
The product is avallale in posilon no. 2
2102
OK
OK
OK Cancet
Cancel
ProblemsImndor ecieation wConcole
E Probleme lavados Declartion Console
dyd lieapdjgalp Aayep ( leve Appicetio Cerh ph
Proscta ls
Proact unber: 112
Product i nber 2
Product saber: 1
Protuct nter:
<temealeds Aelop ( Seve Applicalioni ChUbans
Products List:
Product e number: 1120
Product 1 nunber: 2102
Product 2 nunber: 31e9
Product 3 nunber: 9201
Updated Products' List:
Product e number: 1120
Product 1 nunber: 2102
Product 2 nunber: 9201
Product 3 nunber:
Producta ist
Product number: 1120
Produtt 1 nubar 2z
Product z nusber 3e
Product numper 9201
Mua
2eich product yes vent tanerovet anterthe Indes muniser
(i)
The product ic ramoved tram he
oe
Cae
OK
Provide screen shots of your answer and program code.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F12498924-ea11-4d4b-a55f-1e9535d4131a%2F36f0da52-908b-4a95-82ed-898f34f2160d%2Fpkyjj8r_processed.jpeg&w=3840&q=75)
Transcribed Image Text:AnayApp t ve eplanon Cu pnApoohol AayAop oa Appiration C hhpoalginndema r osle
Write a Java program that obtains products' numbers (array named productsI), 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:
ArnyOperations java a "Anayop java
inport javax. sking. J0ptionPane,
3 public class ArrayApp (
public static void main(String(1 args) {
Arryoperations obj - new Arryoperations();
obj.initializeArray();
obj.printárray();
int searcho - Integer
19
he
hi
porseint (J0ptionPane, showImputDialog( "Do you want to search for a product? 1- Yes, 2- No")):
if (searcho 1) {
obj. searcharray():
12
h4
int Ramoveg - Integer
porseint(30ptionPane. showInputoialog("Do you want to remove a product from the list? 1- Yes, 2- No"));
if (Removeg 1) (
obj.renovearray();
hs
A sample run is shown below.
Problems lavadoc Ducleration Corsole
Problens Javaduc Declo alkon OCusole
Arayhpp (1) (leva Applieation Carhpl.pponhplugi Amypn ( ava Application CersholnzpoehghigrayApy (1) ave Apslikatiun Crstipkpzpoule
EPrablems vadne Decltion Console
Irout
Inpul
Inpit
? Enter product 1 number?
2102
? How many products you store includes
Enter product o number?
1120
Cancel
OK Cancel
OK
Cancel
OK
Problemsvadne Declaration Conscle
Problems lavadee Declieton contole
AroblameiovadocDedaratios concolo
Producte uer 120
Product 1 ben 21ez
Product 2 ueber 31es
Product murber 201
Input
Input
Enter product 2 number?
Int
3109
2 Enter product 3 mumber?
9201
? De yo wa to saarah nor a preY 1 Yes, a.
Cancel
OK
ок
On Cana
Cancel
Prula Jaradue 6 Dedareet DCuol
AnayAnp 1 lava Appkanon C npoonplAayAnp ) fawa Appiration Cuehhepoahphi iyoe ktlCl apoolglagieagockpjujuper
Products List
Product e number: 1120
Product i number: 2182
Product 2 number 3i09
Product 3 number: 9201
Bobieralevodes Dlarelior. OCorsule
rohiees Idar eon Console
Preducts st:
Product e nunber: 1120
Product 1 nunber: 2102
Product 2 nunber: ze0
Product a munber 901
Producta Liat:
Product e nunber: 112
Product 1 nunber 2102
Product 2 nunter 11e
Procuct nunber; 1201
Input
Meccage
which product you want to display
2 Do voe want to ramovea product tro the lat 1-Ye, 2-No
The product is avallale in posilon no. 2
2102
OK
OK
OK Cancet
Cancel
ProblemsImndor ecieation wConcole
E Probleme lavados Declartion Console
dyd lieapdjgalp Aayep ( leve Appicetio Cerh ph
Proscta ls
Proact unber: 112
Product i nber 2
Product saber: 1
Protuct nter:
<temealeds Aelop ( Seve Applicalioni ChUbans
Products List:
Product e number: 1120
Product 1 nunber: 2102
Product 2 nunber: 31e9
Product 3 nunber: 9201
Updated Products' List:
Product e number: 1120
Product 1 nunber: 2102
Product 2 nunber: 9201
Product 3 nunber:
Producta ist
Product number: 1120
Produtt 1 nubar 2z
Product z nusber 3e
Product numper 9201
Mua
2eich product yes vent tanerovet anterthe Indes muniser
(i)
The product ic ramoved tram he
oe
Cae
OK
Provide screen shots of your answer and program code.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 12 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY