(Solved) : 3 Save Plan Groupmemberslastnames Secnopa4plan Download Plarn Instructions Plan Template L Q37264803 . . .






Use Java.
3. Save your plan as GroupMembersLastNames SecNoPA4Plan. Download the plarn instructions and the plan template through the links posted for this assignment on Blackboard Download the Creating Projects in DrJava PDF (instructor’s version) on how to create a project folder that manages multiple .java files stored in the same folder. The project folder has the same name as the group members .java file. You are creating 3 separate java files to red in the project folder: a. GroupMembersLastNames SectionNoPANo.java contains only the main(). b. AddressBook.java, and c. Addressee.java. 4. The fields/class variables are non-static. All methods are non-static except for the main). The non-static methods do not have the word “static” in their headers. 5. The main() will instantiate (create) an object of the AddressBook class and use that object to call start). Make sure you exit main(). 6. The AddressBook class will have 4 methods: a. an empty constructor, b. start(), c. createAddressBook(), d. and displayAddressBook() e. There are NO value-returning and/or value-receiving methods in the AddressBook class. You will create a 1D array called addressBook at the class level as a null array. The type for this array will be Addressee f. In start(0), i. if the answer is “Y” to begin entering addresses, then createAddressBook() and displayAddressBook() are called otherwise the program exits with this message: Exiting program 11. g. In createAddressBook), the user is prompted for the number of contacts to be entered in the addressBook array. That number will be used to give size to the array. For all 3 classes, the only call to clear the buffer is after the prompt for the number of addressees. In displayAddressBook(0, the output is printed according to specs (see sample output) 7. The Addressee class will have the set methods to capture the addressee’s information and the get methods to return the captured data. a. Code an empty constructor. b. Code a method called setAddressee() that prompts for each addressee. c. Code a method called setStreet() that prompts for the addressee’s street. d. Code a method called setCityStateZip() that prompts for the addressee’s city, state, and zip e. Code a method called setPhone() that prompts for the addressee’s 10 digit phone number. f. Code a method called setRelationship( in which that prompts for the relationship of the addressee: family, friend, or work. No need to clear the buffer in this method. g. Code get methods for each field (class-level variable) that has a set method. These get methods only return the fields (class-level variables) 8. Code at the class level only those variables that need to be used by more than one method 7 for Addressee 3 for AddressBook. a. b. 9. Commenting Your Program a. In each program, YOU MUST insert a program purpose in the first comment box. The for chapter 1 b. Use Javadoc comment boxes beginning with and ending with */ for your comment boxes. c. Insert a Javadoc comment box above your methods explaining what is going on in the method including the main() which is also a method. O Linda Shepherd: PA4 instructions and code. O Star Trek characters created by Gene Roddenberry and trademarks of CBS Studios Inc.: Addressor & Addressees d. Line comment the import statements and the variables declared at the class level and/or in any method [including main)]. e. Comments are worth about 5% of the PA grade. 10. Formtting Rules: a. Double-space after colons and end-of-sentence punctuation. b. Single-space after commas and semicolons c. Line advances for prompts, messages, and final output. i. Prompts and final output using printf: 1) When printing lines between the first and the last final output lines a) without “%n” gives you no line advances. b) with one “%n” after each printed line to print the next line, especially when the output is concatenated in one printf statement. There’s no blank line between printed lines. with two “%n” after each printed line to double-line advance between lines, especially when the output is concatenated in one printf statement. There’s one blank line between printed lines. c) d) with three “%n” after each printed line to triple-line advance between lines lines between printea lines 2) When printing the first prompt or the first line of the final output: a) Use one “%n” for a double-line advance. b) Use two “%n” for a triple-line advance and so forth. Messages that are not prompts should begin with “%n” and end with or”%n” to facilitate double-line advancing before the message and before the printed line after the message. ii. i Always test your output to validate that your program is functioning properly with the correct output and spacing (line advances and spacing after punctuation). The %n can function differently when using separate printf statements versus one printf. PROMPTS: Code the bold from the prompts below in the printf statements that capture data into your program. Once again, the prompts tell you your input variables. Keep in mind that these prompts are not all in the same class. 1st Prompt Code in start(). The method start) will be the only method from the AddressBook class called by the main0). Begin entering addresses? ‘Y or ‘N: If the answer to the above question is “N” display the following message: Exiting program. Linda Shepherd: PA4 instructions and code Star Trek characters created by Gene Roddenberry and trademarks of CBS Studios Inc.: Addressor & Addressees. 4 If the answer is “Y” then proceed to prompts 2 through 8 2nd Prompt: Code in createAddressBook) Enter your name: 3rd Prompt: Code in createAddressBook). The value captured here is the size for the array called addressBook How many contacts will be recorded in your address book? 4th Prompt: Code in setAddressee0. Enter the name of the addressee 5th Promot Code in setStreet(). Where the Xs represent the addressee’s name. Enter the street for Xxxxxxxxxxxx: 6th Prompt Code in setCityStateZip(0). Where the Xs represent the addressee’s name. Enter the city, state and zip code for Xxxxxxxxxxxx in the correct format: 7th Prompt: Code in setPhone). Where the Xs represent the addressee’s name. Enter the 10 digit phone number for Xxxxxxxxxxxx without dashes or parentheses: In the field declaration area, you’ll have to code a variable for the phone number as a String, then you’ll have to code a StringBuilder object as follows: private StringBuilder phoneFormatted – null; In this method, right after you capture the phone number you’ll use the StringBuilder object to insent dashes into your phone number. Here’s the code: //SENDING THE PHONE NUMBER IN THE STRING VARIABLE phone TO THE //STRINGBUILDER OBJECT phoneFormatted, THEN USİNG THAT OBJECT TO INSERT //THE DASHES INTO THE PHONE NUMBER. phoneFormatted – new stringBuilder (phone) phoneFormatted.insert(3, “- phoneFormatted.insert (7,- 8th Prompt Code in setRelationship0). Relationship of addressee: 1. Family 2. Friends 3. Work Choose from the above: FINAL OUTPUT SPECIFICATIONS: The output will print the header, address category, addressee’s name, street, city, state, zip code, and phone number. The specifications are repeated because there can be multiple addresses per category. The Xs represent the name of the owner of the address book, the addressee, the street, city, capitalized abbreviation for the state, zip code, and phone number. The header should be triple-line advanced from the last prompt or output 1. The printing of the output will be in a method called displayAddressBook() from the AddressBook class 2. The Xs in the header is the owner of the address book 3. In this method declare the String objects for family, friends, and work. 4. Also use 3 boolean variables: hasFamily, hasFriends, hasWork to aid in printing each category through single-selection IFs only when there are addressees KHeader (Title): Triple-line advance header title using 2 %n” with 1 %n at the end of the literal. Use 1 “%n” at the beginning of the 2nd header line and 1 at the end. All capital Xs means the owner’s name is in all CAPS. ADDRESS BOOK FOR XXXXXXXXXXXX FAMILY Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx FRIENDS Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx WORK Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxx)x Show transcribed image text 3. Save your plan as GroupMembersLastNames SecNoPA4Plan. Download the plarn instructions and the plan template through the links posted for this assignment on Blackboard Download the Creating Projects in DrJava PDF (instructor’s version) on how to create a project folder that manages multiple .java files stored in the same folder. The project folder has the same name as the group members .java file. You are creating 3 separate java files to red in the project folder: a. GroupMembersLastNames SectionNoPANo.java contains only the main(). b. AddressBook.java, and c. Addressee.java. 4. The fields/class variables are non-static. All methods are non-static except for the main). The non-static methods do not have the word “static” in their headers. 5. The main() will instantiate (create) an object of the AddressBook class and use that object to call start). Make sure you exit main(). 6. The AddressBook class will have 4 methods: a. an empty constructor,
b. start(), c. createAddressBook(), d. and displayAddressBook() e. There are NO value-returning and/or value-receiving methods in the AddressBook class. You will create a 1D array called addressBook at the class level as a null array. The type for this array will be Addressee f. In start(0), i. if the answer is “Y” to begin entering addresses, then createAddressBook() and displayAddressBook() are called otherwise the program exits with this message: Exiting program 11. g. In createAddressBook), the user is prompted for the number of contacts to be entered in the addressBook array. That number will be used to give size to the array. For all 3 classes, the only call to clear the buffer is after the prompt for the number of addressees. In displayAddressBook(0, the output is printed according to specs (see sample output) 7. The Addressee class will have the set methods to capture the addressee’s information and the get methods to return the captured data. a. Code an empty constructor. b. Code a method called setAddressee() that prompts for each addressee. c. Code a method called setStreet() that prompts for the addressee’s street. d. Code a method called setCityStateZip() that prompts for the addressee’s city, state, and zip e. Code a method called setPhone() that prompts for the addressee’s 10 digit phone number. f. Code a method called setRelationship( in which that prompts for the relationship of the addressee: family, friend, or work. No need to clear the buffer in this method. g. Code get methods for each field (class-level variable) that has a set method. These get methods only return the fields (class-level variables) 8. Code at the class level only those variables that need to be used by more than one method 7 for Addressee 3 for AddressBook. a. b.
9. Commenting Your Program a. In each program, YOU MUST insert a program purpose in the first comment box. The for chapter 1 b. Use Javadoc comment boxes beginning with and ending with */ for your comment boxes. c. Insert a Javadoc comment box above your methods explaining what is going on in the method including the main() which is also a method. O Linda Shepherd: PA4 instructions and code. O Star Trek characters created by Gene Roddenberry and trademarks of CBS Studios Inc.: Addressor & Addressees d. Line comment the import statements and the variables declared at the class level and/or in any method [including main)]. e. Comments are worth about 5% of the PA grade. 10. Formtting Rules: a. Double-space after colons and end-of-sentence punctuation. b. Single-space after commas and semicolons c. Line advances for prompts, messages, and final output. i. Prompts and final output using printf: 1) When printing lines between the first and the last final output lines a) without “%n” gives you no line advances. b) with one “%n” after each printed line to print the next line, especially when the output is concatenated in one printf statement. There’s no blank line between printed lines. with two “%n” after each printed line to double-line advance between lines, especially when the output is concatenated in one printf statement. There’s one blank line between printed lines. c) d) with three “%n” after each printed line to triple-line advance between lines
lines between printea lines 2) When printing the first prompt or the first line of the final output: a) Use one “%n” for a double-line advance. b) Use two “%n” for a triple-line advance and so forth. Messages that are not prompts should begin with “%n” and end with or”%n” to facilitate double-line advancing before the message and before the printed line after the message. ii. i Always test your output to validate that your program is functioning properly with the correct output and spacing (line advances and spacing after punctuation). The %n can function differently when using separate printf statements versus one printf. PROMPTS: Code the bold from the prompts below in the printf statements that capture data into your program. Once again, the prompts tell you your input variables. Keep in mind that these prompts are not all in the same class. 1st Prompt Code in start(). The method start) will be the only method from the AddressBook class called by the main0). Begin entering addresses? ‘Y or ‘N: If the answer to the above question is “N” display the following message: Exiting program. Linda Shepherd: PA4 instructions and code Star Trek characters created by Gene Roddenberry and trademarks of CBS Studios Inc.: Addressor & Addressees. 4 If the answer is “Y” then proceed to prompts 2 through 8 2nd Prompt: Code in createAddressBook) Enter your name: 3rd Prompt: Code in createAddressBook). The value captured here is the size for the array called addressBook How many contacts will be recorded in your address book? 4th Prompt: Code in setAddressee0.
Enter the name of the addressee 5th Promot Code in setStreet(). Where the Xs represent the addressee’s name. Enter the street for Xxxxxxxxxxxx: 6th Prompt Code in setCityStateZip(0). Where the Xs represent the addressee’s name. Enter the city, state and zip code for Xxxxxxxxxxxx in the correct format: 7th Prompt: Code in setPhone). Where the Xs represent the addressee’s name. Enter the 10 digit phone number for Xxxxxxxxxxxx without dashes or parentheses: In the field declaration area, you’ll have to code a variable for the phone number as a String, then you’ll have to code a StringBuilder object as follows: private StringBuilder phoneFormatted – null; In this method, right after you capture the phone number you’ll use the StringBuilder object to insent dashes into your phone number. Here’s the code: //SENDING THE PHONE NUMBER IN THE STRING VARIABLE phone TO THE //STRINGBUILDER OBJECT phoneFormatted, THEN USİNG THAT OBJECT TO INSERT //THE DASHES INTO THE PHONE NUMBER. phoneFormatted – new stringBuilder (phone) phoneFormatted.insert(3, “- phoneFormatted.insert (7,- 8th Prompt Code in setRelationship0). Relationship of addressee: 1. Family 2. Friends
3. Work Choose from the above: FINAL OUTPUT SPECIFICATIONS: The output will print the header, address category, addressee’s name, street, city, state, zip code, and phone number. The specifications are repeated because there can be multiple addresses per category. The Xs represent the name of the owner of the address book, the addressee, the street, city, capitalized abbreviation for the state, zip code, and phone number. The header should be triple-line advanced from the last prompt or output 1. The printing of the output will be in a method called displayAddressBook() from the AddressBook class 2. The Xs in the header is the owner of the address book 3. In this method declare the String objects for family, friends, and work. 4. Also use 3 boolean variables: hasFamily, hasFriends, hasWork to aid in printing each category through single-selection IFs only when there are addressees KHeader (Title): Triple-line advance header title using 2 %n” with 1 %n at the end of the literal. Use 1 “%n” at the beginning of the 2nd header line and 1 at the end. All capital Xs means the owner’s name is in all CAPS. ADDRESS BOOK FOR XXXXXXXXXXXX FAMILY Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx FRIENDS Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxxx City, State Zip: Xxxxxxxxxx, XX xxxxx Phone: xxx-xxx-xxxx WORK Addressee: Xxxxxxxxxxxx Street: Xxxxxxxxxxx)x
Expert Answer
Answer to 3. Save your plan as GroupMembersLastNames SecNoPA4Plan. Download the plarn instructions and the plan template through t…
OR