For beginning Java, need help with this: " Purpose: Define class using OO approach Understand how to create and manipulate list of objects Design and create a well-structure program using basic programming constructs and classes   Description:   Write a program to help you to manage courses you are taking this semester.    Your program provides the following options:     List all courses Add a course Search word: show all the courses that has the word in the course title (ask the user for the word) List >= input-unit: show all the courses that has unit >= input-unit (ask the user for input) Exit   Explanation of options: The program prints your course list. Initially, it should say “Your list is empty” The program asks the user input for a course including: course ID, number of units and title. The program asks the user to input the search word. Then, display all courses that has that word in the title.  The search must be case-insensitive.  For example, “computer” and “Computer” are considered a match. List courses that have the number of unit >= the user input Terminate the program     Requirements: Here is the minimum list of classes that you must have: “java” class             - Manages a course (id, number of units, and title)             - Keep track of course count in a static variable.  You will need this count in other places. “java” program: Implement the main program that perform the following tasks: Declare a course array to keep track of courses. For each course, create one Course object and store it into the course array.  You must declare and array of 20, but you may not need to use all elements. It processes all the commands to manage the courses in your list. It should have a method to search for unit, for example:    public static void searchCourseUnit(       Course[] courseArray, int unitValue) Or              public static void searchCourseUnit(                   Course[] courseArray, int size, int unitValue)   It should have another method to search for word in title, for example:    public static void searchCourseTitle(       Course[] courseArray, String target) Or              public static void searchCourseTitle(                 Course[] courseArray, int size, String target)     You must have comments in your class and methods to describe what the class provide and what the methods do. Here’s an example of a method comment:             /** Create an array of Circle objects */           public static CircleWithPrivateDataFields[] createCircleArray() You must have the block comment at the beginning of each your source file: /***************************************************************************** * Name: Alexa Amazon * Project 2: Manage a list of courses * Date: Oct. 21, 2021 * Description: This program provides a menu for user to manage … ****************************************************************************/" Here is the sample: " Sample run is attached.

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

For beginning Java, need help with this:

"

Purpose:

  • Define class using OO approach
  • Understand how to create and manipulate list of objects
  • Design and create a well-structure program using basic programming constructs and classes

 

Description:

 

Write a program to help you to manage courses you are taking this semester. 

 

Your program provides the following options:

 

 

  1. List all courses
  2. Add a course
  3. Search word: show all the courses that has the word in the course title (ask the user for the word)
  4. List >= input-unit: show all the courses that has unit >= input-unit (ask the user for input)
  5. Exit

 

Explanation of options:

  1. The program prints your course list. Initially, it should say “Your list is empty”
  2. The program asks the user input for a course including: course ID, number of units and title.
  3. The program asks the user to input the search word. Then, display all courses that has that word in the title.  The search must be case-insensitive.  For example, “computer” and “Computer” are considered a match.
  4. List courses that have the number of unit >= the user input
  5. Terminate the program

 

 

Requirements:

  1. Here is the minimum list of classes that you must have:
  2. java” class

            - Manages a course (id, number of units, and title)

            - Keep track of course count in a static variable.  You will need this count in other places.

  1. java” program: Implement the main program that perform the following tasks:
    1. Declare a course array to keep track of courses. For each course, create one Course object and store it into the course array.  You must declare and array of 20, but you may not need to use all elements.
    2. It processes all the commands to manage the courses in your list.
    3. It should have a method to search for unit, for example:

   public static void searchCourseUnit(

      Course[] courseArray, int unitValue)

Or

             public static void searchCourseUnit(

                  Course[] courseArray, int size, int unitValue)

 

  1. It should have another method to search for word in title, for example:

   public static void searchCourseTitle(

      Course[] courseArray, String target)

Or

             public static void searchCourseTitle(

                Course[] courseArray, int size, String target)

 

 

  1. You must have comments in your class and methods to describe what the class provide and what the methods do. Here’s an example of a method comment:

            /** Create an array of Circle objects */

          public static CircleWithPrivateDataFields[] createCircleArray()

  1. You must have the block comment at the beginning of each your source file:

/*****************************************************************************

* Name: Alexa Amazon

* Project 2: Manage a list of courses

* Date: Oct. 21, 2021

* Description: This program provides a menu for user to manage …

****************************************************************************/"

Here is the sample:

"

Sample run is attached.

D:>java ManageCourse
Please choose 1 of the following options:
1. List all courses
2. Add a course
3. Search word: show all the courses that has the word
in the course title (ask the user for the word)
4. List >= input-unit: show all the courses that has
unit >= input-unit (ask the user for input)
5. Exit
Enter your option: 1
Your course list is empty.
Please choose 1 of the following options:
1. List all courses
2. Add a course
3. Search word: show all the courses that has the word
in the course title (ask the user for the word)
4. List >= input-unit: show all the courses that has
unit >= input-unit (ask the user for input)
5. Exit
Enter your option: 2
Enter course ID: CIS001
Enter the number of units: 2
Enter the title: Computer Literacy
Please choose 1 of the following options:
1. List all courses
2. Add a course
3. Search word: show all the courses that has the word
in the course title (ask the user for the word)
4. List >= input-unit: show all the courses that has
unit >= input-unit (ask the user for input)
5. Exit
Enter your option: 2
Enter course ID: CIS010
Transcribed Image Text:D:>java ManageCourse Please choose 1 of the following options: 1. List all courses 2. Add a course 3. Search word: show all the courses that has the word in the course title (ask the user for the word) 4. List >= input-unit: show all the courses that has unit >= input-unit (ask the user for input) 5. Exit Enter your option: 1 Your course list is empty. Please choose 1 of the following options: 1. List all courses 2. Add a course 3. Search word: show all the courses that has the word in the course title (ask the user for the word) 4. List >= input-unit: show all the courses that has unit >= input-unit (ask the user for input) 5. Exit Enter your option: 2 Enter course ID: CIS001 Enter the number of units: 2 Enter the title: Computer Literacy Please choose 1 of the following options: 1. List all courses 2. Add a course 3. Search word: show all the courses that has the word in the course title (ask the user for the word) 4. List >= input-unit: show all the courses that has unit >= input-unit (ask the user for input) 5. Exit Enter your option: 2 Enter course ID: CIS010
Enter the number of units: 5
Enter the title: Computer Programming Lab
Please choose 1 of the following options:
1. List all courses
2. Add a course
3. Search word: show all the courses that has the word
in the course title (ask the user for the word)
4. List >= input-unit: show all the courses that has
unit >= input-unit (ask the user for input)
5. Exit
Enter your option: 1
Your course list:
Unit
Course
CIS001
CIS010
2
5
Please choose 1 of the following options:
Title
Computer Literacy
Computer Programming Lab
1. List all courses
2. Add a course
3. Search word: show all the courses that has the word in
the course title (ask the user for the word)
4. List >= input-unit: show all the courses that has unit
>= input-unit (ask the user for input)
5. Exit
Enter your option: 3
Enter the search word: computer
Course
CIS001
CIS010
All courses that has 'computer' in title:
Unit
2
5
Title
Computer Literacy
Computer Programming Lab
Please choose 1 of the following options:
1. List all courses
2. Add a course
Transcribed Image Text:Enter the number of units: 5 Enter the title: Computer Programming Lab Please choose 1 of the following options: 1. List all courses 2. Add a course 3. Search word: show all the courses that has the word in the course title (ask the user for the word) 4. List >= input-unit: show all the courses that has unit >= input-unit (ask the user for input) 5. Exit Enter your option: 1 Your course list: Unit Course CIS001 CIS010 2 5 Please choose 1 of the following options: Title Computer Literacy Computer Programming Lab 1. List all courses 2. Add a course 3. Search word: show all the courses that has the word in the course title (ask the user for the word) 4. List >= input-unit: show all the courses that has unit >= input-unit (ask the user for input) 5. Exit Enter your option: 3 Enter the search word: computer Course CIS001 CIS010 All courses that has 'computer' in title: Unit 2 5 Title Computer Literacy Computer Programming Lab Please choose 1 of the following options: 1. List all courses 2. Add a course
Expert Solution
Step 1: Algorithm:

Algorithm for Course Management Program:

1. Create a Course class with private fields for courseId, units, and title.
2. Define a constructor in the Course class to initialize these fields.
3. Provide getter methods in the Course class to access the private fields.
4. Create a ManageCourse class with a main method to manage courses.
5. Initialize an array of Course objects with a capacity of 20 and a course count variable.
6. Use a while loop to display a menu of options to the user.
7. Inside the loop:
   a. Prompt the user to choose an option (1-5).
   b. Use a switch statement to handle the selected option.
   c. Case 1: List all courses
      - Check if the course count is 0, if so, print "Your course list is empty."
      - Otherwise, loop through the Course array and display each course's details.
   d. Case 2: Add a course
      - Check if the course count is less than 20 (array capacity).
      - If so, prompt the user for course ID, units, and title.
      - Create a new Course object with the entered details and add it to the array.
      - Increment the course count.
   e. Case 3: Search courses by word in the title
      - Prompt the user for a search word.
      - Loop through the Course array and check if the title contains the search word.
      - Display the details of matching courses.
   f. Case 4: List courses with units >= input-unit
      - Prompt the user for a minimum unit value.
      - Loop through the Course array and check if units are greater than or equal to the input value.
      - Display the details of matching courses.
   g. Case 5: Exit the program
      - Display an exit message and terminate the program.
8. End of the while loop.


trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Reference Types in Function
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