Placeholder

PRG 420 Week 4 Individual Assignment Creates and Accesses an Array of Integers

$9.99

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:
Download and unzip the linked Week Four Coding Assigment Zip File.
Read each line of the file carefully, including the detailed instructions at the top.
Add comments to the code by typing your name and the date in the multi-line comment header.
Replace the following lines with Java™ code as directed in the file:
LINE 1
LINE 2
LINE 3
LINE 4
LINE 5
Comment each line of code you add to explain what you intend the code to do.
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.

Description

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:
Download and unzip the linked Week Four Coding Assigment Zip File.
Read each line of the file carefully, including the detailed instructions at the top.
Add comments to the code by typing your name and the date in the multi-line comment header.
Replace the following lines with Java™ code as directed in the file:
LINE 1
LINE 2
LINE 3
LINE 4
LINE 5
Comment each line of code you add to explain what you intend the code to do.
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.
SCREENSHOTS
SOLUTION
PAYMENT
PRG 420 Week 4 Screenshot
PRG 420 Week 4 Individual Assignment
The solution consists of:
A Java program includes fully commented
A Netbeans project in case you want to run the project on your computer.
Screenshots while running program
Attachments [Move over files to preview content of those files]
PRG_420_Week_4.zip (97.09 KB)
Netbeans Project
PRG420Week4
pom.xml
src
main
java
PRG420Week4.java
test
java
target
classes
.netbeans_automatic_build
PRG420Week4.class
generated-sources
annotations
maven-status
maven-compiler-plugin
compile
default-compile
createdFiles.lst
inputFiles.lst
test-classes
.netbeans_automatic_build
PRG420-Week-4-Screenshot-1.png
PRG420-Week-4-Screenshot-2.png
Source Code
PRG420Week4.java
Preview PRG420Week4.java
xxxxx = xxx xxx[10];
// xxxxxx x xxxxxx xxxxxxxx xx xx xxxxx xxxxxx
xxxxxxx xxxxxxxxxxxxxxxxxxxxxx = xxx xxxxxxx(xxxxxx.xx);
// xx xxxx xxx x xxxx xx xxxx xx xx xxxxxxx. xxxx xxxx xx xxxx xxxxxxxx
// code WE ARE NOT VERIFYING WHETHER THE USER ACTUALLY // TYPES AN INTEGER OR NOT. In a production program, we would // need to verify this; for example, by including // exception handling code. (As-is, a user can type in XYZ // and that will cause an exception.) System.out.println(“Enter an integer and hit Return: “);
// Convert the user input (which comes in as a string even // though we ask the user for an integer) to an integer
int myFirstArrayElement = Integer.parseInt(myInputScannerInstance.next());
// xxxx 3. xxxxxxxxxx xxx xxxxx xxxxx xxxxxxx xxxx xxx xxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxx
xxxxx[0] = xxxxxxxxxxxxxxxxxxx;
// xxxx 4. xxxxxxxxxx xxx xxxxxx xxxxxxx xxx xxxxx xxxxxxxx xx xxxxxx 100 xx xxx xxxx xxxxxxxxx xxxxx.
xxx (xxx x=1; x < 10; x++) { // xxxx xxx xx xxx xxxxxxx xx xxxxx
xxxxx[x] = xxxxx[x – 1] + 100; // xxxxxx xxx xxxxx xx xxxxxxx xxxxxxx xx xxxxx xx xxxxxxxx xxxxxxx xxxx 100
}
Preview PRG420Week4.java
xxxxx = xxx xxx[10];
// xxxxxx x xxxxxx xxxxxxxx xx xx xxxxx xxxxxx
xxxxxxx xxxxxxxxxxxxxxxxxxxxxx = xxx xxxxxxx(xxxxxx.xx);
// xx xxxx xxx x xxxx xx xxxx xx xx xxxxxxx. xxxx xxxx xx xxxx xxxxxxxx
// code WE ARE NOT VERIFYING WHETHER THE USER ACTUALLY // TYPES AN INTEGER OR NOT. In a production program, we would // need to verify this; for example, by including // exception handling code. (As-is, a user can type in XYZ // and that will cause an exception.) System.out.println(“Enter an integer and hit Return: “);
// Convert the user input (which comes in as a string even // though we ask the user for an integer) to an integer
int myFirstArrayElement = Integer.parseInt(myInputScannerInstance.next());
// xxxx 3. xxxxxxxxxx xxx xxxxx xxxxx xxxxxxx xxxx xxx xxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxx
xxxxx[0] = xxxxxxxxxxxxxxxxxxx;
// xxxx 4. xxxxxxxxxx xxx xxxxxx xxxxxxx xxx xxxxx xxxxxxxx xx xxxxxx 100 xx xxx xxxx xxxxxxxxx xxxxx.
xxx (xxx x=1; x < 10; x++) { // xxxx xxx xx xxx xxxxxxx xx xxxxx
xxxxx[x] = xxxxx[x – 1] + 100; // xxxxxx xxx xxxxx xx xxxxxxx xxxxxxx xx xxxxx xx xxxxxxxx xxxxxxx xxxx 100
}
Price: $19
Buy Now
Checkout
Added to cart
Buy More Save More
Buy at least TWO items & save up to 30% OFF your ENTIRE order!
Rack up instant rebates in your shopping cart. Simply add items to your cart, and see the savings add up.
Discounts will automatically be applied on eligible orders.
PRG 420 Week 4 Individual Assignment – $19.00
PRG 420 Week 5 Individual Assignment – $19.00
Add to Cart
Checkout
Added to cart
You May Also Like:
PRG 420 Week 1 Individual Assignment Hello World
PRG 420 Week 2 Individual Assignment Triangle Rectangle Polygon
PRG 420 Week 3 Individual Assignment For While and Do While Loops
PRG 420 Week 5 Individual Assignment Exception Handling

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.