Question: Please ignore first pic LE 6.1 68A.pd (SECURED) -Adobe Reader File Edit View Window Help 52.8% Tools Fill & Sign Comment IS 2031-LE 0.1 Sections
Please ignore first pic










LE 6.1 68A.pd (SECURED) -Adobe Reader File Edit View Window Help 52.8% Tools Fill & Sign Comment IS 2031-LE 0.1 Sections Purpose: To leam how to code two (2) separate one-dimensional arrays and process them in parallel with one another Prep Work: Read chapter 6 and your instructor's chapter 6 PowerPoint slides. Lab Exercise 6uInstructios: In the main) of a program called 1java, code an aray that contains the top 3 jackpot winnings in millions. Code a second array that holds the locations/states in which the winnings were won. Code a for loop that will populate the arays by prompting for the winnings span multple locatione/states. Then, code another for loop that wil display the content from these arrays as follows. and then the locations/states. Sometimes the same winnings can Outout Scecrications where the Xs represent the srate's name and the Zs the total area in square miles. Here's code for some of the output Systern.outprint n%nTHE TOP 3 JACKPOT WINNING5%n. Use this print() when array index is less than 2: System out printr-in $%, 1Mt %s", winning locatione), Otherwise, use thie printl System.outprintr7%n 8%,. 1ntt %s", winningS , locatorDD: M blank spaces before format specifier, 5 blank spaces afer last ) W6 blank spaces before format specifier, 5 blank spaces ater last t) THE TOP 3 JACKPOT WINNINGS WINNINGS IN MILLIONS LOCATION Grading Requirements: Duing lab class, enter your name on the sign-up sheet for grading when your assignment is in gradable condition. O Linda Shepherd O Type here to search 4:21 PM 11/18/2018 2 IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help 3 / 8 |-+ | 75% Tools Fill & Sign Comment 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 TeamStats class and use that object to call start). Make sure you exit main). 6. The TeamStats class will have 4 methods: an empty constructor, start), processWinsLosses), and displayTeamsstats). There are NO value-retuming and/or value-receiving methods in the TeamStats class. You will create a 1D array called myTeams at the class level as a null array. The type for this array will be Team a. In start, OLinda Shepherd i. if the answer is "Y" to tracking the performance of your teams then processWinsLosses) and displayTeamsStats() are called; i. otherwise the program exits with this message: Thank you! Exiting program. b. In ). the user is prompted for the number or teams to be tracked by the program. That number will be used to give size to the myTeams aray. For a3 classes, the only call to clear the buffer is ater the prompt for the number of athletic teams. C. In displayTeamsStats), the output is printed according to specs (see sample output). It also has the calculation for the d. Your output will have uppercase and lowercase for the same word in different parts of the print out. You'll need two (2) methods from the String class: toLowerCase) and toUpperCase. Use the String variable to call these methods 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help 3 / 8 |-+ | 75% Tools Fill & Sign Comment 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 TeamStats class and use that object to call start). Make sure you exit main). 6. The TeamStats class will have 4 methods: an empty constructor, start), processWinsLosses), and displayTeamsstats). There are NO value-retuming and/or value-receiving methods in the TeamStats class. You will create a 1D array called myTeams at the class level as a null array. The type for this array will be Team a. In start, OLinda Shepherd i. if the answer is "Y" to tracking the performance of your teams then processWinsLosses) and displayTeamsStats() are called; i. otherwise the program exits with this message: Thank you! Exiting program. b. In ). the user is prompted for the number or teams to be tracked by the program. That number will be used to give size to the myTeams aray. For a3 classes, the only call to clear the buffer is ater the prompt for the number of athletic teams. C. In displayTeamsStats), the output is printed according to specs (see sample output). It also has the calculation for the d. Your output will have uppercase and lowercase for the same word in different parts of the print out. You'll need two (2) methods from the String class: toLowerCase) and toUpperCase. Use the String variable to call these methods 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help 3 / 8 |-+ | 75% Tools Fill & Sign Comment i. Example: school.toUpperCase() where school is the String variable that stores the school's name 7. The Team lass will have the set methods to capture the team information and the get methods to return the captured data. a. Code an empty constructor b. Code an overloaded constructor that accepts the data for the team and its coach. Assign the parameter variables to fiekds (class-level variables) with the same name c. Code a method called setTeam) that prompts for each team type d. Code a method called setCoach) that prompts for the team's coach. e. Code a method called setTotalGames that prompts for the total number games played by the team. No need to clear the buffer in this method . Code a method called setWins() that prompts for the team's number of wins. No need to clear butfer. No need to dlear the butter in this method q. Code get methods for each field (class-level variable) that has a set method. These get methods only return the tields (class-level variables). 8. Code at the class level only those variables that need to be used by more than one method. a. 6 for Team. b. 4 for TeamStats. eLinda Shepherd 9:03 AM O Type here to search e @ 11/26/2018 2 IS2033- PA4 ASSIGNMENT (SECURED)- Adobe Reader File Edit View Window Help 75% Tools Fill& SignComment a. Double-space ater 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 printt 1) When printing lines between the first and the last final output lines without %n" gives you no line advances. with one-%n-after each printed line to print the next line, especially when the output is concatenated in one printt statement. There's no blank line between a) b) printed lines. c) with two "%n" after each printed line to double-line advance between lines. especially when the output is concatenated in one printf statement. blank line between printed lines. with three .%n" after each printed line to tnple-line advance between lines, especially when the output is concatenated in one printt statement. There's 2 blank lines between printed lines. There's one d) 2) When printing the first prompt or the first line of the final output. a) Use one-%n" for a double-line advance. ii. 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. Always test your output to validate that your program is functioning property with the correct output and spacing (line advances and spacing after punctuation). The %n can function differently when using separate printf statements versus one print. nda Shepherd 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment 75% 1st Promp Code in start. The method stat) wi be the only method rom the TeamStats class called by the maino. Do you want to track the performance of the athletic teams at your school? Enter Y or 'N*: If the answer to the above question is "N display the folowing message Thank you! Exiting program. If the answer is "Y then proceed to prompts 2 through 7. 2nd Promot Code in processWinsLosses0. What is the name of your school? 3rd Promot Code in processWinsLosses). The value captured here is the size of the array called myTeams. How many athletic teams do you have at your school? 4th Prompt: Code in setTeamO. Enter the team type 5th Prompt Code in Enter the name of the coach: setCoach0. 6th Prompt: Code in setTotalGames(). The Xs represent the type of the team (basketball, footbal, etc.). Note the team type is al lowercase Enter the total number of games played for the xxxxxxxxxxxx team 7th Prompt Code in Enter the number of wins for the xxxxxxxxxxxx team: setWins). The xs represent the type of the team. FINAL OUTPUT SPECIFICATIONS: The output wW print the header, the team's name, the coach the totai number or games piayed, the number of wins, the number of losses and the win percent as a decimal. There are mwripie teams wnich is why the output specs are repeated. The number of 9:03 AM O Type here to search e @ 11/26/2018 2 IS 2033-PAA ASSIGNMENT (SECURED)-Adobe Reader File Edit View Window Help 6 / 8 75% Tools Fill & Sign Comment 7th Prompt: Code in setWins0. The Xs represent the type of the team. Enter the number of wins for the xxxxxxxxxxxx team: FINAL OUTPUT SPECIFICATIONS: The output wW print the header, the team's name, the coach the totai number or games piayed, the number of wins, the number of losses and the win percent as a decimai. There are multipie teams which is why the output specs are repeated The number of losses Is caicuiated The header shouid be triple-line advanced trom the last prompt or output. The printing of the output will be in a method called displayTeamsStats0 from the TeamStats claSS. The Xs in the header is the school name. OLinda Shepherd Headers (Titles): Triple-line advance 1st line of header title using 2 "%n". All capital Xs means all CAPS TEAMS WIN-LOSS RECORD FOR Team: Xxxxxxxxxxxx Coach: Xxxxxxxxxxxx Total Games: Zz9 No. of Wins: Zz9 No. of Losses: ZZ9 Win Percent: ZZ9.99% Team: XXxxxxXxxxxx Coach: Xxxxxxxxxxxx Total Games: ZZ9 No. of Wins: ZZ9 No. of Losses: ZZ9 Win Percent: ZZ9.99% END OF OUTPUT SPECIFICATIONS 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment m"SAMPLE OUTPUT : It is aways good to test your code using sample data to see your program meets the output specifications. Check to make sure your output matches the sample d correction(s) in your code and re-run the output. Copy and paste the output into a comment box at the end of your PA4.java file that has the main). Tne comment box needs to be outside of the close brace for the class. Change your font in DrJava to Monospaced or Courier New if your output is out of alignment. Worth 5 points! Your output will not print in bold. t in line advances, and wording. It not, make the necessary SAMPLE OUTPUT WHEN ANSWER IS "N"* Do you want to track the pertormance of the athletic teams at your school? Enter Y or 'N': n Thank you! Exiting program. SAMPLE OUTPUT WHEN ANSWER IS "Y Do you want to track the performance of the athletic teams at your school? Enter"Y' or 'N': y What is the name of your school? Ace High School How many athletic teams do you have at your school? 3 Enter the team type: Basketball Enter the name of the coach: Warner Enter the a nmber of games played for the basketball team: 14 Enter the number of wins for the basketball team: 8 Enter the team type: Football Enter the name of the coach: Phillips Enter the total number of games played for the football team: 12 Enter the number of wins for the football team: 10 9:04 AM O Type here to search e @ 11/26/2018 2 IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment Enter the team type: Baseball Enter the name of the coach: Robins Enter the total number of games played for the baseball team: 30 Enter the number of wins for the baseball team: 12 TEAMS WIN-LOSS RECORD FOR ACE HIGH SCHOOL eLinda Shepherd Team: Basketball Coach: Warner Total Games: 14 No. of Wins: 8 No. of Losses: 6 Win Percent: 57.14% Team: Football Coach: Phillips Total Games: 12 No. of Wins: 10 No. of Losses: 2 Win Percent: 83.33% Team: Baseball Coach: Robins Total Games: 30 No. of Wins: 12 No. of Losses: 18 9:04 AM O Type here to search IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment Team: Basketball Coach: Warner Total Games: 14 No. of Wins: 8 No. of Losses: 6 Win Percent: 57.14% Team: Football Coach: Phillips Total Games: 12 No. of Wins: 10 No. of Losses: 2 Win Percent: 83.33% Team: Baseball Coach: Robins Total Games: 30 No. of Wins: 12 No. of Losses: 18 Win Percent: 40.00% Screenshot saved The screenshot was added to your OneDrive. 9:04 AM O Type here to search e @ LE 6.1 68A.pd (SECURED) -Adobe Reader File Edit View Window Help 52.8% Tools Fill & Sign Comment IS 2031-LE 0.1 Sections Purpose: To leam how to code two (2) separate one-dimensional arrays and process them in parallel with one another Prep Work: Read chapter 6 and your instructor's chapter 6 PowerPoint slides. Lab Exercise 6uInstructios: In the main) of a program called 1java, code an aray that contains the top 3 jackpot winnings in millions. Code a second array that holds the locations/states in which the winnings were won. Code a for loop that will populate the arays by prompting for the winnings span multple locatione/states. Then, code another for loop that wil display the content from these arrays as follows. and then the locations/states. Sometimes the same winnings can Outout Scecrications where the Xs represent the srate's name and the Zs the total area in square miles. Here's code for some of the output Systern.outprint n%nTHE TOP 3 JACKPOT WINNING5%n. Use this print() when array index is less than 2: System out printr-in $%, 1Mt %s", winning locatione), Otherwise, use thie printl System.outprintr7%n 8%,. 1ntt %s", winningS , locatorDD: M blank spaces before format specifier, 5 blank spaces afer last ) W6 blank spaces before format specifier, 5 blank spaces ater last t) THE TOP 3 JACKPOT WINNINGS WINNINGS IN MILLIONS LOCATION Grading Requirements: Duing lab class, enter your name on the sign-up sheet for grading when your assignment is in gradable condition. O Linda Shepherd O Type here to search 4:21 PM 11/18/2018 2 IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help 3 / 8 |-+ | 75% Tools Fill & Sign Comment 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 TeamStats class and use that object to call start). Make sure you exit main). 6. The TeamStats class will have 4 methods: an empty constructor, start), processWinsLosses), and displayTeamsstats). There are NO value-retuming and/or value-receiving methods in the TeamStats class. You will create a 1D array called myTeams at the class level as a null array. The type for this array will be Team a. In start, OLinda Shepherd i. if the answer is "Y" to tracking the performance of your teams then processWinsLosses) and displayTeamsStats() are called; i. otherwise the program exits with this message: Thank you! Exiting program. b. In ). the user is prompted for the number or teams to be tracked by the program. That number will be used to give size to the myTeams aray. For a3 classes, the only call to clear the buffer is ater the prompt for the number of athletic teams. C. In displayTeamsStats), the output is printed according to specs (see sample output). It also has the calculation for the d. Your output will have uppercase and lowercase for the same word in different parts of the print out. You'll need two (2) methods from the String class: toLowerCase) and toUpperCase. Use the String variable to call these methods 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help 3 / 8 |-+ | 75% Tools Fill & Sign Comment 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 TeamStats class and use that object to call start). Make sure you exit main). 6. The TeamStats class will have 4 methods: an empty constructor, start), processWinsLosses), and displayTeamsstats). There are NO value-retuming and/or value-receiving methods in the TeamStats class. You will create a 1D array called myTeams at the class level as a null array. The type for this array will be Team a. In start, OLinda Shepherd i. if the answer is "Y" to tracking the performance of your teams then processWinsLosses) and displayTeamsStats() are called; i. otherwise the program exits with this message: Thank you! Exiting program. b. In ). the user is prompted for the number or teams to be tracked by the program. That number will be used to give size to the myTeams aray. For a3 classes, the only call to clear the buffer is ater the prompt for the number of athletic teams. C. In displayTeamsStats), the output is printed according to specs (see sample output). It also has the calculation for the d. Your output will have uppercase and lowercase for the same word in different parts of the print out. You'll need two (2) methods from the String class: toLowerCase) and toUpperCase. Use the String variable to call these methods 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help 3 / 8 |-+ | 75% Tools Fill & Sign Comment i. Example: school.toUpperCase() where school is the String variable that stores the school's name 7. The Team lass will have the set methods to capture the team information and the get methods to return the captured data. a. Code an empty constructor b. Code an overloaded constructor that accepts the data for the team and its coach. Assign the parameter variables to fiekds (class-level variables) with the same name c. Code a method called setTeam) that prompts for each team type d. Code a method called setCoach) that prompts for the team's coach. e. Code a method called setTotalGames that prompts for the total number games played by the team. No need to clear the buffer in this method . Code a method called setWins() that prompts for the team's number of wins. No need to clear butfer. No need to dlear the butter in this method q. Code get methods for each field (class-level variable) that has a set method. These get methods only return the tields (class-level variables). 8. Code at the class level only those variables that need to be used by more than one method. a. 6 for Team. b. 4 for TeamStats. eLinda Shepherd 9:03 AM O Type here to search e @ 11/26/2018 2 IS2033- PA4 ASSIGNMENT (SECURED)- Adobe Reader File Edit View Window Help 75% Tools Fill& SignComment a. Double-space ater 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 printt 1) When printing lines between the first and the last final output lines without %n" gives you no line advances. with one-%n-after each printed line to print the next line, especially when the output is concatenated in one printt statement. There's no blank line between a) b) printed lines. c) with two "%n" after each printed line to double-line advance between lines. especially when the output is concatenated in one printf statement. blank line between printed lines. with three .%n" after each printed line to tnple-line advance between lines, especially when the output is concatenated in one printt statement. There's 2 blank lines between printed lines. There's one d) 2) When printing the first prompt or the first line of the final output. a) Use one-%n" for a double-line advance. ii. 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. Always test your output to validate that your program is functioning property with the correct output and spacing (line advances and spacing after punctuation). The %n can function differently when using separate printf statements versus one print. nda Shepherd 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment 75% 1st Promp Code in start. The method stat) wi be the only method rom the TeamStats class called by the maino. Do you want to track the performance of the athletic teams at your school? Enter Y or 'N*: If the answer to the above question is "N display the folowing message Thank you! Exiting program. If the answer is "Y then proceed to prompts 2 through 7. 2nd Promot Code in processWinsLosses0. What is the name of your school? 3rd Promot Code in processWinsLosses). The value captured here is the size of the array called myTeams. How many athletic teams do you have at your school? 4th Prompt: Code in setTeamO. Enter the team type 5th Prompt Code in Enter the name of the coach: setCoach0. 6th Prompt: Code in setTotalGames(). The Xs represent the type of the team (basketball, footbal, etc.). Note the team type is al lowercase Enter the total number of games played for the xxxxxxxxxxxx team 7th Prompt Code in Enter the number of wins for the xxxxxxxxxxxx team: setWins). The xs represent the type of the team. FINAL OUTPUT SPECIFICATIONS: The output wW print the header, the team's name, the coach the totai number or games piayed, the number of wins, the number of losses and the win percent as a decimal. There are mwripie teams wnich is why the output specs are repeated. The number of 9:03 AM O Type here to search e @ 11/26/2018 2 IS 2033-PAA ASSIGNMENT (SECURED)-Adobe Reader File Edit View Window Help 6 / 8 75% Tools Fill & Sign Comment 7th Prompt: Code in setWins0. The Xs represent the type of the team. Enter the number of wins for the xxxxxxxxxxxx team: FINAL OUTPUT SPECIFICATIONS: The output wW print the header, the team's name, the coach the totai number or games piayed, the number of wins, the number of losses and the win percent as a decimai. There are multipie teams which is why the output specs are repeated The number of losses Is caicuiated The header shouid be triple-line advanced trom the last prompt or output. The printing of the output will be in a method called displayTeamsStats0 from the TeamStats claSS. The Xs in the header is the school name. OLinda Shepherd Headers (Titles): Triple-line advance 1st line of header title using 2 "%n". All capital Xs means all CAPS TEAMS WIN-LOSS RECORD FOR Team: Xxxxxxxxxxxx Coach: Xxxxxxxxxxxx Total Games: Zz9 No. of Wins: Zz9 No. of Losses: ZZ9 Win Percent: ZZ9.99% Team: XXxxxxXxxxxx Coach: Xxxxxxxxxxxx Total Games: ZZ9 No. of Wins: ZZ9 No. of Losses: ZZ9 Win Percent: ZZ9.99% END OF OUTPUT SPECIFICATIONS 9:03 AM O Type here to search e @ IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment m"SAMPLE OUTPUT : It is aways good to test your code using sample data to see your program meets the output specifications. Check to make sure your output matches the sample d correction(s) in your code and re-run the output. Copy and paste the output into a comment box at the end of your PA4.java file that has the main). Tne comment box needs to be outside of the close brace for the class. Change your font in DrJava to Monospaced or Courier New if your output is out of alignment. Worth 5 points! Your output will not print in bold. t in line advances, and wording. It not, make the necessary SAMPLE OUTPUT WHEN ANSWER IS "N"* Do you want to track the pertormance of the athletic teams at your school? Enter Y or 'N': n Thank you! Exiting program. SAMPLE OUTPUT WHEN ANSWER IS "Y Do you want to track the performance of the athletic teams at your school? Enter"Y' or 'N': y What is the name of your school? Ace High School How many athletic teams do you have at your school? 3 Enter the team type: Basketball Enter the name of the coach: Warner Enter the a nmber of games played for the basketball team: 14 Enter the number of wins for the basketball team: 8 Enter the team type: Football Enter the name of the coach: Phillips Enter the total number of games played for the football team: 12 Enter the number of wins for the football team: 10 9:04 AM O Type here to search e @ 11/26/2018 2 IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment Enter the team type: Baseball Enter the name of the coach: Robins Enter the total number of games played for the baseball team: 30 Enter the number of wins for the baseball team: 12 TEAMS WIN-LOSS RECORD FOR ACE HIGH SCHOOL eLinda Shepherd Team: Basketball Coach: Warner Total Games: 14 No. of Wins: 8 No. of Losses: 6 Win Percent: 57.14% Team: Football Coach: Phillips Total Games: 12 No. of Wins: 10 No. of Losses: 2 Win Percent: 83.33% Team: Baseball Coach: Robins Total Games: 30 No. of Wins: 12 No. of Losses: 18 9:04 AM O Type here to search IS 2033- PA4 ASSIGNMENT (SECURED) - Adobe Readen File Edit View Window Help Tools Fill & Sign Comment Team: Basketball Coach: Warner Total Games: 14 No. of Wins: 8 No. of Losses: 6 Win Percent: 57.14% Team: Football Coach: Phillips Total Games: 12 No. of Wins: 10 No. of Losses: 2 Win Percent: 83.33% Team: Baseball Coach: Robins Total Games: 30 No. of Wins: 12 No. of Losses: 18 Win Percent: 40.00% Screenshot saved The screenshot was added to your OneDrive. 9:04 AM O Type here to search e @
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
