Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2 Write a Java program to allow user to manage project teams and project members. Each project team has a unique name, and
Question 2 Write a Java program to allow user to manage project teams and project members. Each project team has a unique name, and it can include many project members. Each project member has a unique id, name and email (unique). The details of the classes are given as follows: class Instance variables Constructor Get and set methods Other methods toString ProjMember id, name and email of a member. You may decide the type of each instance variable. You may include additional variables as you deem fit. A non default constructor that receives parameters and initialises the instance variables. Include get and set methods for all instance variables. You may include additional methods as you deem fit. Return a descriptive String of the instance. class Instance variables Constructor Get and set methods Other methods toString ProjTeam Team name Members of the team. Hint: ArrayList You may decide the type of each instance variable. You may include additional variables as you deem fit. A non default constructor that receives one parameter which is the name of the project team. Include get and set methods for all instance variables. You may include additional methods as you deem fit. Return a descriptive String which includes the detail of each project member in the team. The program will maintain a list of project team and a list of project members. When the program is started, both lists are empty. The program will allow the user to perform the following operations repeatedly: 1 Add member 2 Remove member 3 Add project team 4 Add member to project team 5 Remove member from project team 6 Print all teams 7 Quit You may assume that the input values of project name, member id, name and email will be in the correct type and format. Option 1 Add member The program will prompt the user to enter id, name and email of a member. The program must check that the id and email do not belong to an existing project member in the member list. If the values are valid, the program will add it as a ProjMember instance into the member list. Otherwise, the program will display an appropriate message. Option 2 Remove member The program will prompt the user to enter an id, find the ProjMember instance in the member list that matches the id, and remove the instance from the list If there is no matching instance, the program will display an appropriate message. If an instance is found, the program must check if the instance is assigned to any project team. If it is assigned, the program will not remove the instance but will display an appropriate message. Option 3 Add project team The program will prompt the user to enter the name of a project team. The program must check that the name does not belong to an existing project team in the project list. If the name is valid, the program will add it as a new instance in the project list. Otherwise, the program will display an appropriate message. Option 4 Add member to project team The program will prompt the user to enter a project team name and a member id. The program will check if there is a matching project team (in the project list) and project member (in the member list). If there is no matching project team or member, the program will display an appropriate message. Otherwise, the program will add the member to the project team. Option 5 Remove member from project team The program will prompt the user to enter a project team name and a member id. The program will check if there is a matching project team (in the project list), and the team has a member with the matching id. If there is no matching project team or member, the program will display an appropriate message. Otherwise, the program will remove the member from the project team. Option 6 Print all teams The program will print all the teams in the team list (refer to the toString method of ProjTeam). Program Structure You may include additional classes as you deem fit. public class Question 2 { public static void main(String[] argv) { // Your code ... } class Proj Member { // Your code } class Proj Team { // Your code } ...
Step by Step Solution
★★★★★
3.39 Rating (143 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started