Loops: Write a program that uses a loop to diplay Pattern A below, followed by another loop that displays Pattern B.

public class Pattern {
public static void main(String[] args) {
// TODO Auto-generated method stub
//Printing Pattern A
//Using two for loops for the given scenario
System.out.println("Pattern A:");
for(int i = 1; i<=10; i++){
for (int j =1; j<=i; j++){
System.out.print("+");
}
//Printing an empty line after each row
System.out.println();
}
System.out.println("\nPattern B: ");
//Printing pattern B
for(int i = 10; i>=1; i--){
for (int j =1; j<=i; j++){
System.out.print("+");
}
//Printing an empty line after each row
System.out.println();
}
}
}
Output:
![<terminated> Tester4 (1) [Java Application] Pattern A Pattern B](http://img.homeworklib.com/questions/7c1f9140-6f79-11ec-ad32-21967e894e90.png?x-oss-process=image/resize,w_560)
C++ any help is appreciated Program Pattern#2: Write a program that uses nested loop or for statements to display Pattern A below, followed by an empty line and then another set of loops that displays Pattern B. Once again no setw implementation is allowed here but you must use nested loop or for statements with proper indentation to generate these patterns. Use meaningful variable identifier names, good prompting messages and appropriate comments for each loop segment as well as other...
Write them in python IDLE *****
5. Average Rainfall
Write a program that uses nested loops to collect data
and calculate the average rainfall over a period of years. The
program should first ask for the number of years. The outer loop
will iterate once for each year. The inner loop will iterate twelve
times, once for each month. Each iteration of the inner loop will
ask the user for the inches of rainfall for that month. After all
iterations,...
Java: makes sure program compiles before posting. Write a program that uses nested for loops to create the pattern of Xs and Os, in which on every line each letter is displayed one additional space to the right. Use a toggle variable ( a boolean flag) to alternate between X and O to produce output as shown in the sample run below: Enter the number of lines: 7 X O X O X O X
Turtle Graphics with nested loop: Write a turtle graphics python program repeat_squares.py that uses nested loops to draw 100 squares, to create this design: Turtle-squares.png starting with the smallest square in the bottom right-hand corner. Start at position (-4,4). At each step increase the length of each side by 4 pixels. Draw 100 squares. Please submit with an animation speed of 0 and the turtle hidden turtle.hideturtle()
***** JAVA ONLY ***** Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. Frist the program should ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the...
Programming exercise. Number 25. Turtle Graphics: Checkerboard Write a turtle graphics program that uses the square function presented in this chapter, along with a loop (or loops) to draw the checkerboard pattern shown in Figure 5-32. Figure 5-32 Checkerboard pattern. Book Starting Out With Python $th Edition, Tony Gaddis
python
Write a Python program to construct the following pattern, using a nested for loop. * * * * * * * * * * * * * * * * * * * * * * * * * * *
B.1Suppose that we want to print the pattern shown below using a loop structure (the printing of all stars should be done inside loop structure). What is the minimum number of loops that is needed to produce this pattern? Select one: a Two loops: one loop to control the number of stars per line and the second one to print the stars in the line b. This depends on the type of loop: two loops are needed if we use...
Small Basic Programming Question: Average score Write a program that uses loops to collect data and calculate the average score over a number of tests for a number of students. The program should : 1. first ask the user to enter the number of students in the range of 1 to 10. 2. then the program asks the user to enter the number of tests (in the range of 1 to 5) 3. Then use a loop to collect the...
Write a java program that uses a loop to input, from the user not using gui, a collection of values that are the number of steps taken each day for a sequence of days and stores those amounts in an array. the array length should be 31, The user is not required to enter 31 values. the program determines and displays the largest number of steps for a single day, the smallest number of steps for a single day and...