PRG/420 Entire Week 2018 Tutorials
PRG/420 Week 4 Learning Team: FAQ: Arrays Answer the following questions as a team: 1. What data types can an array contain? 2. How do you delete (remove) a value from an array? 3. How do you "read" (access and display) the values or elements in an array? 4. What happens to an array when the program ends? After your team has finished answering the questions collectively, add them, along with the question text, to your Java FAQ document. Refer to the Week 1 Task, "Learning Team: Formatting a Java™ FAQ". Individual: Analyzing a Program Containing Arrays Resource: Week Four Analyze Assignment Zip File The ability to read through Java™ code and predict the results, given specific inputs, is an extremely useful skill. For this assignment, you will be analyzing the Java™ code in the linked Week Four Analyze Assignment Text File, and answering questions about the array that appears in the code. Carefully read through the code line by line, then answer the following questions in a Microsoft® Word document: 1. If an array had not been chosen to hold the data manipulated in this program, how else (i.e., with what other data types) could it have been represented? 2. Which approach, using an array or using the alternative you identified in question #1, is shorter/easier? 3. What is the output of this program? 4. What would be the result of using a println() statement to display the value of arraynum? 5. How many values can arraynum contain, and why? Submit your completed Word document using the Assignment Files tab. Individual: Coding a Program Containing an Array Includes Working Java Build and Program File - Option#1 Includes Working Java Build and Program File - Option#2 Resource: Week Four Coding Assigment Zip File (starter code for this assignment that includes placeholders) For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program that creates and accesses an array of integers. The Java™ program you write should do the following: • Create an array to hold 10 integers • Ask the user for an integer. Note: This code has already been written for you. • Populate the array. Note: The first element should be the integer input by the user. The second through tenth elements should each be the previous element + 100. For example, if the user inputs 10, the first array value should be 10, the second 110, the third 210, and so on. • Display the contents of the array on the screen in ascending index order. Complete this assignment by doing the following: 1. Download and unzip the linked Week Four Coding Assigment Zip File. 2. Read each line of the file carefully, including the detailed instructions at the top. 3. Add comments to the code by typing your name and the date in the multi-line comment header. 4. Replace the following lines with Java™ code as directed in the file: • LINE 1 • LINE 2 • LINE 3 • LINE 4 • LINE 5 5. Comment each line of code you add to explain what you intend the code to do. 6. Test and modify your Java™ program until it runs without errors and produces the results as described above. Note: Refer to this week's analyzing code assignment if you need help. Submit your Java source (.java) code file using the Assignment Files tab.
0.25MB ZIP File