Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The question involves object oriented programming or Java programming. The compiler used is Java SE Development Kit 17 for windows. Take note that part (b)
The question involves object oriented programming or Java programming. The compiler used is Java SE Development Kit 17 for windows. Take note that part (b) is already answered and will post the remaining question after (c) is answered.
Q1 Register Profile name : String . contact: int Access # username : String # pass wurl : int A TeadImpul(): void readContact(Scanner input, Access aUser) : void success Message (Access newuser, Profile contacts) : void Login login Menu(Access registered use"):void checkLogin(Access Uaer. Access userRecord); void Figure Ql(a): Class Diagram (a) Class Profile characterised personal details of emergency contact person. (1) 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 read Input () to display the following output which instantiate Access object and initialise it to user input from the command prompt as in Figure Q1(b). C. Command Prompt - java Menu C: REGISTER Enter matric number : AT010375 Enter last four digit of IC number: 6231 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) 1 (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 citiergency contact person using the passed Scanner object. Enter emergency contact person 1 : Mother Enter emergency contact person 1 phone number(digit only) : 0124512365 Enter emergency contact person 2 : Father Enter emergency contact person 2 phone number(digit only): 0113542698 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 Qi(d). (3 marks) (vii) Invoke loginMenu() by passing the received Access object. Message D Succesfully registered. Emergency contact 1. Mother, 124512365 Emergency contact 2 Father, 124512365 Proceed to login | 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. (1) Create class Login with the given relationship as in Figure Q1(a). (2 marks) (ii) Refine the logitMenu() 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. 2 LOGIN Enter matric number : AT010375 Enter last four digit of IC number : 6231 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)() and the Access object passed in Q1(b)(vii) and. (1 marks) (iv) Refine check Login to verify using an if statement whether the received arguments username and password from login matches the one given during registration. Message X Welcome A10103751 Figure Q1 (g): Expected Output for Successful login (1 marks) (e) Create main() in a new .java file and invoke readInput (). (1 marks) 3Step by Step Solution
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