Nested for Loops
What output is produced by the following program?
public class Loops { OUTPUT
public static void main(String[] args) {
for (int i = 1; i <= 10; i++) {
for (int j = 1; j < i; j++) {
System.out.print(” “);
}
for (int j = 1; j <= 21 – 2 * i; j++) {
System.out.print(“*”);
}
System.out.println();
}
}
}
Write a static method named drawFigure that produces the following output. Use for loops to capture the structure of the figure.
////////\\
//////****\
////********\
//************
****************
Modify your method from the previous exercise so that it uses a class constant for the figure’s size. The previous output used a constant size of 5. Here is the output for a constant size of 3:
////\
//****
********
 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post information-technology-43 appeared first on Essay Fount.


What Students Are Saying About Us

.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but you proved you are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"

.......... Customer ID: 11***| Rating: ⭐⭐⭐⭐⭐
"This company is the best there is. They saved me so many times, I cannot even keep count. Now I recommend it to all my friends, and none of them have complained about it. The writers here are excellent."


"Order a custom Paper on Similar Assignment at essayfount.com! No Plagiarism! Enjoy 20% Discount!"