PRG 420 Week 3 Individual Assignment For While and Do While Loops
$9.99
For this assignment, you will apply what you learned in analyzing for, while, and do-while loops by writing these statements yourself. The Java™ program you write should do the following:
Display a pyramid of asterisks onscreen (i.e., a nested for loop)
Display the integers 10 to 1 in decreasing order, one number per line (i.e., a while/do-whlie loop)
Add 7 until the sum becomes greater than 157, at which point the program should display both the sum and the number of 7s added
Complete this assignment by doing the following:
Download and unzip the linked Week Three Coding Assigment Zip File.
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
Comment each line of code you add to explain what you intend the code to do and why you chose each type of loop.
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 for, while, and do-while loops by writing these statements yourself. The Java™ program you write should do the following:
Display a pyramid of asterisks onscreen (i.e., a nested for loop)
Display the integers 10 to 1 in decreasing order, one number per line (i.e., a while/do-whlie loop)
Add 7 until the sum becomes greater than 157, at which point the program should display both the sum and the number of 7s added
Complete this assignment by doing the following:
Download and unzip the linked Week Three Coding Assigment Zip File.
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
Comment each line of code you add to explain what you intend the code to do and why you chose each type of loop.
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 3 Screenshot
PRG 420 Week 3 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_3.zip (81.35 KB)
Netbeans Project
PRG420Week3
pom.xml
src
main
java
PRG420Week3.java
target
classes
.netbeans_automatic_build
PRG420Week3.class
generated-sources
annotations
maven-status
maven-compiler-plugin
compile
default-compile
createdFiles.lst
inputFiles.lst
test-classes
.netbeans_automatic_build
PRG420-Week-3-Screenshot-1.png
PRG420-Week-3-Screenshot-2.png
Source Code
PRG420Week3.java
Preview PRG420Week3.java
xxxxxx xxxxx xxx420xxxx3 {
xxxxxx xxxxxx xxxx xxxx(xxxxxx[] xxxx) {
int linesOfAsterisks = 5; for (int i = 1; i <= linesOfAsterisks; i++) { // for each line… // LINE 1. ADD A NESTED FOR LOOP THAT DISPLAYS ONE ASTERISK ON LINE 1, TWO ASTERISKS ON LINE 2, 3 ASTERISKS ON LINE 3, ETC. for (int j=1; j <= i; j++) { // use for loop to print character * i times System.out.print(‘*’); } xxxxxx.xxx.xxxxxxx(); } xxx xxx = 10; //xxxx 2. xxx x xxxx xxxx xxxxxxxx xxxxxxx 10 xx 1 xx xxxxxxxxxx xxxxx (xxxx: xxxxxxxxx xxxxxxxx) xxx (xxx x=xxx; x > 0; x–) { // xxx xxx xxxx xxxxxxxxx
Preview PRG420Week3.java
xxxxxx xxxxx xxx420xxxx3 {
xxxxxx xxxxxx xxxx xxxx(xxxxxx[] xxxx) {
int linesOfAsterisks = 5; for (int i = 1; i <= linesOfAsterisks; i++) { // for each line… // LINE 1. ADD A NESTED FOR LOOP THAT DISPLAYS ONE ASTERISK ON LINE 1, TWO ASTERISKS ON LINE 2, 3 ASTERISKS ON LINE 3, ETC. for (int j=1; j <= i; j++) { // use for loop to print character * i times System.out.print(‘*’); } xxxxxx.xxx.xxxxxxx(); } xxx xxx = 10; //xxxx 2. xxx x xxxx xxxx xxxxxxxx xxxxxxx 10 xx 1 xx xxxxxxxxxx xxxxx (xxxx: xxxxxxxxx xxxxxxxx) xxx (xxx x=xxx; x > 0; x–) { // xxx xxx xxxx xxxxxxxxx
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 3 Individual Assignment – $19.00
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 4 Individual Assignment Creates and Accesses an Array of Integers
PRG 420 Week 5 Individual Assignment Exception Handling
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.