Reference no: EM132902145
Part 1: Designing, Coding, and Documenting a Person Class
Overview
Goal and Directions:
In this activity, you will design and implement a Person class based on a UML class model. Complete the following tasks for this activity:
Execution
Execute this assignment according to the following guidelines:
1. Create a UML diagram for a Person class by using your favorite UML drawing tool, such as Microsoft Word, Microsoft Visio, Draw.io, or something else. Create a variety of properties and methods that describe what a person's attributes and actions. Students taking this course on campus should do an in-class activity with the whiteboard to model a Person class.
2. Create a new Java Project using the File ? New ? Java Project menu items and name your project topic1-2. Also validate that your project is configured to use the JavaSE-1.8 JRE. Click the Finish button.
3. Right click on the project folder within the Project and select the New ? Class menu options. Name your class Person and put in a package named app. Click the public static void main() method creation option. Click Finish.
a. Add the state variables that were modeled as class private member variables.
b. Create a constructor that initializes your Person state variables with parameter values.
c. Create a getter and setter method for all of the state variables using Eclipse Refactoring (use the Source ? Generate Getter and Setters.... menu options).
d. Add the behavior methods that were modeled as public class methods.
e. Add console print statements to each method that displays appropriate testing messages.
f. In the main() method, create an instance of the Person class and call each of the public methods.
4. Run the Person class.
5. Take a screenshot of the console when executing the Person class.
6. Provide a brief (3- to 4-sentence) description of how and why the output was displayed.
7. Using JavaDoc conventions using Eclipse (enter /** [return] above each class method), document your class and all methods. Generate the JavaDoc using Eclipse with following steps:
a. Select the Project ? Generate Javadoc... menu options.
b. Select your project.
c. Use the standard doclet.
d. Set the location where you want the JavaDoc generated. The default location is the doc folder inside of the project.
e. Click the Generate button.
f. Validate the documentation by opening the index.html generated by JavaDoc.
8. Create a UML class diagram of your Person class.
Deliverables:
The following need to be submitted as this part of the activity:
a. Theory of operation write-ups.
b. UML class diagram of the Person class.
c. Screenshot of the console output when running the Person class.
d. Submit a zip file of your source code, including the generated Javadoc files.
Part 2: Using the Debugger
Overview
Goal and Directions:
In this activity, you will be given some tutorials and various debugger operations, such as setting breakpoints, inspecting variables, stepping thru code, and inspecting the call stack, that you will practice using code developed in this activity. The following are requirements to complete this activity:
Execution
Execute this assignment according to the following guidelines:
1. Read the Eclipse Debugger tutorial. Open the Debug Perspective in Eclipse. Inspect each of the Debugger Icons by hovering your mouse over each of the icons, as well as the Debug menu items located within the Run menu.
2. Open the project from topic1-2 project.
1. Setting Breakpoints:
a. Open up the Person class.
b. Set a breakpoint on one of the statements in the main() method and another breakpoint on one of the classes methods.
c. Run the application in debug mode by clicking the Debug icon from the Eclipse toolbar.
d. Take a screenshot of the first breakpoint stopped in the debugger.
e. Click the Resume icon from the Eclipse toolbar.
f. Take a screenshot of the second breakpoint stopped in the debugger.
g. Remove all breakpoints.
h. Click the Resume icon from the Eclipse toolbar.
2. Inspecting Variables:
a. Remove the breakpoints that were previously set.
b. Set a new breakpoint on a different method in the class.
c. Run the application in debug mode by clicking the Debug icon from the Eclipse toolbar.
d. Inspect all of the class member variables in the Variables Window.
e. Take a screenshot of the Variables Window in the debugger.
f. Remove all breakpoints.
g. Click the Resume icon from the Eclipse toolbar.
3. Stepping Into a Function, Step Over Function, and Step Return from a function:
a. Set a breakpoint on one of the statements in the main() that calls a method in the Person class.
b. Run the application in debug mode by clicking the Debug icon from the Eclipse toolbar.
c. Verify that code stopped at the breakpoint.
d. Click the Step Into icon from the Eclipse toolbar to step into the method.
e. Verify that you are in line 1 of the method.
f. Click the Step Over icon from the Eclipse toolbar and inspect all local variables during each step. Continue clicking the Step Over icon until you have reached the last line of the method.
g. Click the Step Return icon from the Eclipse toolbar.
h. Verify that you are in the method callback in the main() method.
i. Take a screenshot of the debugger.
j. Click the Resume icon from the Eclipse toolbar.
k. Remove all breakpoints.
4. Inspecting the Call Stack:
a. Set a breakpoint on one of the statements in the main() that calls a method in the Person class.
b. Run the application in debug mode by clicking the Debug icon from the Eclipse toolbar.
c. Verify that code stopped at the breakpoint.
d. Click the Step Into icon from the Eclipse toolbar to step into the method.
e. Verify that you are in line 1 of the method.
f. Click the Step Over icon from the Eclipse toolbar and inspect all local variables during each step. Continue clicking the Step Over icon until you have reached the last line of the method.
g. Inspect the Debug (Call Stack) Window.
h. Take a screenshot of the Debug (Call Stack) Window.
i. Remove all breakpoints.
j. Click the Resume icon from the Eclipse toolbar.
Deliverables:
The following need to be submitted as this part of the activity:
a. Screenshot from the Setting Breakpoints task.
b. Screenshots from the Inspecting Variables task.
c. Screenshots from the Stepping task.
d. Screenshot from the Inspecting Call Stack task.
Attachment:- Programming Exercise.rar