Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java please . . . . This programming assignment is intended to demonstrate your knowledge of the following: Using files Using loops Using if statements

java please image text in transcribed
image text in transcribed
. . . . This programming assignment is intended to demonstrate your knowledge of the following: Using files Using loops Using if statements Arrays of strings ArrayList Class Selection Sort Creating an inventory Project 1. Open Eclipse and create a project named Projects. 2. Create a Java main class called ProductNames. ProductNames.txt - This file contains a list of the 20 product names 3. Write code that reads the contents of the file into an array, or ArrayList named products. 4. Use a for each loop to display the name for each individual product in the products array 5. Create a displayProducts method that accepts a one-dimensional array and use a for each loop to display the name for each individual product in the products array. 6. Display the contents of the array under the heading "Unordered list". 7. Create a sortProducts method that accepts a one-dimensional array its argument. The method sorts the array using a selection sort. The method returns a sorted array 8. Display the contents of the array under the heading "Unordered list". 9. Sort the array using a selection sort. 10. Display the contents of the array under the heading "Ordered list". 11. Create a search Products method that accepts a one-dimensional array and a string as its arguments. Use a sequential/linear search to identify if the product is in the array. If the name is in the array, the method should return the position. If the number is not in the array, the method should return -1. When the user enters the name of a product, the program should step through the array or ArrayList. 12. In the main method, display the result of the search identifying the position it was found at or displaying a "Not Found" message. 13. Remove any unnecessary code. . Expected Output: Unordered list Pencil pouch pens Pencil sharpener High lighters Markers Erasers Binder Notebooks Index cards Folders Glue Ruler Scissors Calculator Calendar Backpack lunch box laptop bag Graph paper White-out

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

The type of organization and its style of leadership

Answered: 1 week ago