Question 2 Write a Java program to allow user to manage project teams and project members....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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<ProjMember> 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 } ... 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<ProjMember> 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 } ...
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
PLEASE HELP. LAST ATTEMPT. ACCOUNTING. THANK YOU SOMUCH!!!!!!! Total estimated overhead costs for the two product lines are \( \$ 756,800 \). (a1) X Your answer is incorrect. Calculate overhead rate....
-
The following items were selected from among the transactions completed by O'Donnel Co. during the current year: Jan. 10. Purchased merchandise on account from Laine Co., $240,000, terms n/30. Feb....
-
Brand Landscaping offers a promotion where they will mow your lawn 20 times if the customer pays $700 in advance. Required: Prepare the journal entry to record (1) The customers prepayment of $700...
-
In Figure VI.1, what is the direction of the electric field in the region between the cathode and the target electrode? A. To the left B. To the right C. Toward the top of the page D. Toward the...
-
Accountants for Smithson, Inc. have assembled the following data for the year ended December 31, 2016: Prepare Smithsons statement of cash flows using the indirect method. Include an accompanying...
-
Find a cognitive training app. List the name of the app. Download and play one of the games. Explain what the purpose of the game was and how it improves cognition.?
-
A compound containing only carbon and hydrogen is analyzed, and is found to contain 20.11% hydrogen on a mass basis. Show how the empirical formula of the compound may be calculated.
-
So, if Im correct that with this law in place it protcts the righs more of a tenant? A landlord is not authorized to collect a security deposit that exceeds the amount of 2 months' rent in a single...
-
The North Melbourne Manufacturing Company Ltd belongs to the Capital Goods industry group under the Industrials sector. Identify three firms that belong to the same industry group listed on the ASX,...
-
On January 2, 2019, Best Corporation issued 3,000 shares of its $15 par-value common stock for cash at $36 a share. Prepare a journal entry to record the issuance of the stock. Journal entry...
-
A toy car is moving on a circular banked incline having an incline angle of 25.0. If the maximum speed the car can travel without slipping is 7.50 m/s, determine the radius (m) of the circular bank....
-
You are the CFO of Motor City Spirits Co. in Detroit. The owner is considering two new products, a Rye or a Bourbon, but can only support one. Both products require some upfront costs and have...
-
Why work specialization is an unending source of increased production?
-
In Exercises discuss the continuity of each function. f(x) -3 1 x - 4 y 3 2 -1 -2 -3+ 3 X
-
Interpersonal skills refer to your ability to communicate with, understand, and motivate both individuals and groups. This exercise gives you a chance to see whether the factors that motivate you...
-
In your opinion, if you had to choose either Steve Jobs or Tim Cook to lead your company, who would you choose? Why?
-
Using the information about managing start-ups and new ventures presented in this chapter, analyze whether you would like to work in a start-up or new venture, either as an employee or as a founder....
-
In Appendix 16A.1, we illustrate the calculation of a standard error for the marginal effect in a probit model of transportation, Example 16.4. In the appendix, the calculation is for the marginal...
-
In Example 16.3, we illustrate the calculation of the likelihood function for the probit model in a small example. a. Calculate the probability that \(y=1\) if \(x=1.5\), given the values of the...
-
In Examples 16.2 and 16.4, we presented the linear probability and probit model estimates using an example of transportation choice. The logit model for the same example is \(P(A U T...
Study smarter with the SolutionInn App