Question: Q1 Figure Q1(a): Class Diagram (a) Class Profile characterised personal details of emergency contact person. (i) Create class Profile with the given data fields, data

Q1 Figure Q1(a): Class Diagram (a) Class Profile characterised personal details of emergency contact person. (i) Create class Profile with the given data fields, data type, and access modifiers as in Figure Q1(a). (1 marks) (ii) Code the accessor and mutator for the given data fields. (4 marks) (iii) Construct a parameterised constructor for class Profile which initialise instance variables name and contact using mutators in Q1(a)(ii). (2 marks) (b) Class Register facilitates registration for system access by new student, record personal details of two emergency contact person, and display emergency contact details upon successful registration. (i) Create class Register with the given behaviour, return type, and access modifiers as in Figure Q1(a). (4 marks) (ii) Refine the readInput() to display the following output which instantiate Access object and initialise it to user input from the command prompt as in Figure Q1(b). Figure Q1(b): Expected Output for Access Registration (5 marks) (iii) invoke readContact() by passing the Scanner object and the Access object used in Q1(b)(ii). (1 marks) 2 CONFIDENTIAL CONFIDENTIAL DAT 10603 (iv) Refine readContact() to use array of objects from Profile class to store user input as in Figure Q1(c) for information details of two emergency contact person using the passed Scanner object. Figure Q1(c): Expected Output for Emergency Contacts Details (8 marks) (v) Passed the received Access object and the initialised array of objects to successMessage(). (1 marks) (vi) Refine successMessage() to access the passed array of objects to display information of the two emergency contact in a dialog box as in Figure Q1(d). (3 marks) (vii) Invoke loginMenu() by passing the received Access object. Figure Q1(d): Dialog box Upon Successful Registration (1 marks) (c) Class Access characterises the system access details. (i) Create class Access with the given data fields, data type, and access modifiers as in Figure Q1(a). (1 marks) (ii) Create ONE(1) default constructor and ONE(1) parameterised constructor to initialise all member variables for Access class. (2 marks) (d) Class Login facilitates system login, login access verification and login error message. (i) Create class Login with the given relationship as in Figure Q1(a). (2 marks) 3 CONFIDENTIAL CONFIDENTIAL DAT 10603 (ii) Refine the loginMenu() to display the following output which take user input from the command prompt using Scanner object as in Figure Q1(e) as instance variables data field. Figure Q1(e): Expected Output for Login (2 marks) (iii) Import necessary library for Login.java and invoke checkLogin() by passing the initialised Access object in Q1(d)(ii) and the Access object passed in Q1(b)(vii) and. (1 marks) (iv) Refine checkLogin()to verify using an if statement whether the received arguments username and password from login matches the one given during registration. Figure Q1(g): Expected Output for Successful login (1 marks) (e) Create main() in a new .java file and invoke readInput(). (1 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!