Create a menu driven program that does the following:     Single Array Project Enter values for List 1 Enter values for List 2  Display sorted Merged List sorted Search the Merged List for a certain number Count the occurrence of each number in the merged list Exit program    Menu Option 1: Enter the positive integer values from the keyboard for List 1. Enter a maximum of 10 numbers. But, you do not have to enter 10 numbers. Negative 1 (-1) signify the end of your list.     Menu Option 2: Enter the positive integer values from the keyboard for List 2. Enter a maximum of 10 numbers. But, you do not have to enter 10 numbers. Negative 1 (-1) signify the end of your list.  Menu Option 3: Merge List 1 and List 2. Sort and display the merged list. Menu Option 4: Get a number to search for from the user. Search for that number in the MERGED list and give the index position. If the number is not found, let the user know.    Menu Option 5: Count the occurrence of each unique number in the MERGED listed. A sample output is below: Merged numbers: 2, 5, 6, 5, 4, 3, 23, 43, 2, 0, 5, 3, 23, 2, 5, 232 occurs 3 times3 occurs 2 times4 occurs 1 time5 occurs 4 times6 occurs 1 time23 occurs 3 times43 occurs 1 timeNote that if a number occurs more than one time, the plural word “times” is usedin the output. Note: ALL Menu options above should invoke at least one method call to perform that task.   *** Additional Code Requirements: *** Be sure to create a comment block header as described in class. Be sure to document your code and let the user know exactly what they are to input from the keyboard and exactly what they are looking when you display output. Now is a good time to make use of a static input stream as discussed in class (i.e. static Scanner input = new Scanner(System.in)) declared outside the main but within the class so that all of your classes can use the same input variable rather than declaring many variables that do the same thing.  You are not required to use the java.util.Arrays methods but you are more than welcome to use them.  Be sure to use at least one foreach loop in your code.

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
icon
Related questions
Question
100%

Create a menu driven program that does the following:

   

Single Array Project

  1. Enter values for List 1
  2. Enter values for List 2 
  3. Display sorted Merged List sorted
  4. Search the Merged List for a certain number
  5. Count the occurrence of each number in the merged list
  6. Exit program   

Menu Option 1: Enter the positive integer values from the keyboard for List 1. Enter a maximum of 10 numbers. But, you do not have to enter 10 numbers. Negative 1 (-1) signify the end of your list.    

Menu Option 2: Enter the positive integer values from the keyboard for List 2. Enter a maximum of 10 numbers. But, you do not have to enter 10 numbers. Negative 1 (-1) signify the end of your list. 

Menu Option 3: Merge List 1 and List 2. Sort and display the merged list.

Menu Option 4: Get a number to search for from the user. Search for that number in the MERGED list and give the index position. If the number is not found, let the user know. 

  Menu Option 5: Count the occurrence of each unique number in the MERGED listed. A sample output is below:

Merged numbers: 2, 5, 6, 5, 4, 3, 23, 43, 2, 0, 5, 3, 23, 2, 5, 23
2 occurs 3 times
3 occurs 2 times
4 occurs 1 time
5 occurs 4 times
6 occurs 1 time
23 occurs 3 times
43 occurs 1 time
Note that if a number occurs more than one time, the plural word “times” is used
in the output.

Note: ALL Menu options above should invoke at least one method call to perform that task.

 

*** Additional Code Requirements: ***

  • Be sure to create a comment block header as described in class.
  • Be sure to document your code and let the user know exactly what they are to input from the keyboard and exactly what they are looking when you display output.
  • Now is a good time to make use of a static input stream as discussed in class (i.e. static Scanner input = new Scanner(System.in)) declared outside the main but within the class so that all of your classes can use the same input variable rather than declaring many variables that do the same thing. 
  • You are not required to use the java.util.Arrays methods but you are more than welcome to use them. 
  • Be sure to use at least one foreach loop in your code.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education