6. In the Driver.java class, modify the main method. In main(), you must create a menu loop that does the following: o Displays the menu by calling the displayMenu method. This method is in the Driver.java class. o Prompts the user for input o Takes the appropriate action based on the value that the user entered

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

I need help in my intro to programming class (Java) in creating a loop that covers the criteria in the first picture also included begining of the Driver class that includes the menu options.

6. In the Driver.java class, modify the main method. In main(), you must create a menu loop that does the following:
• Displays the menu by calling the displayMenu method. This method is in the Driver.java class.
o Prompts the user for input
o Takes the appropriate action based on the value that the user entered
Transcribed Image Text:6. In the Driver.java class, modify the main method. In main(), you must create a menu loop that does the following: • Displays the menu by calling the displayMenu method. This method is in the Driver.java class. o Prompts the user for input o Takes the appropriate action based on the value that the user entered
10 import java.util.ArrayList;
2 import java.util.Scanner;
3
4 public class Driver {
private static ArrayList<Dog> dogList = new ArrayList<Dog> ();
// Instance variables (if needed)
8
//Monkey Array
private static ArrayList<Monkey> monkeyList = new ArrayList<Monkey> ();
10
11e
public static void main (String [] args) {
12
13
14
initializeDogList ();
initializeMonkeyList ();
15
16
// Add a loop that displays the menu, accepts the users input
// and takes the appropriate action.
// For the project submission you must also include input validation
// and appropriate feedback to the user.
// Hint: create a Scanner and pass it to the necessary
// methods
// Hint: Menu options 4, 5, and 6 should all connect to the printAnimals () method.
17
18
19
20
21
22
23
24
25
26
27
// This method prints the menu options
280
29
30
public static void displayMenu () {
System.out.println ("\n\n");
System.out.println ("\t\t\t\tRescue Animal System Menu");
System.out.println ("[1] Intake a new dog");
31
32
33
System.out.println (" [2] Intake a new monkey");
System.out.println ("[3] Reserve an animal");
System.out.println ("[4] Print a list of all dogs");
System.out.println ("[5] Print a list of all monkeys") ;
System.out.println ("[6] Print a list of all animals that are not reserved");
System.out.println ("[a] Quit application");
em.out.println ():
System.out.println ("Enter a menu selection");
34
35
36
37
38
Sys
39
40
41
42
Transcribed Image Text:10 import java.util.ArrayList; 2 import java.util.Scanner; 3 4 public class Driver { private static ArrayList<Dog> dogList = new ArrayList<Dog> (); // Instance variables (if needed) 8 //Monkey Array private static ArrayList<Monkey> monkeyList = new ArrayList<Monkey> (); 10 11e public static void main (String [] args) { 12 13 14 initializeDogList (); initializeMonkeyList (); 15 16 // Add a loop that displays the menu, accepts the users input // and takes the appropriate action. // For the project submission you must also include input validation // and appropriate feedback to the user. // Hint: create a Scanner and pass it to the necessary // methods // Hint: Menu options 4, 5, and 6 should all connect to the printAnimals () method. 17 18 19 20 21 22 23 24 25 26 27 // This method prints the menu options 280 29 30 public static void displayMenu () { System.out.println ("\n\n"); System.out.println ("\t\t\t\tRescue Animal System Menu"); System.out.println ("[1] Intake a new dog"); 31 32 33 System.out.println (" [2] Intake a new monkey"); System.out.println ("[3] Reserve an animal"); System.out.println ("[4] Print a list of all dogs"); System.out.println ("[5] Print a list of all monkeys") ; System.out.println ("[6] Print a list of all animals that are not reserved"); System.out.println ("[a] Quit application"); em.out.println (): System.out.println ("Enter a menu selection"); 34 35 36 37 38 Sys 39 40 41 42
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
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
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