1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mila [183]
3 years ago
5

Write a program that uses nested loop or for statements to display Pattern A below, followed by an empty line and then another s

et 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 sections in the body of your program.
Note: Each triangle has exactly seven rows and the width of each row is an odd number. The triangles have appropriate labels displayed.


Pattern A

+

+++

+++++

+++++++

+++++++++

+++++++++++

+++++++++++++

Pattern B

+++++++++++++

+++++++++++

+++++++++

+++++++

+++++

+++

+
Computers and Technology
1 answer:
JulsSmile [24]3 years ago
8 0

Answer:

public class Pyramid {

   public static void main(String[] args) {

             int h = 7;

       System.out.println("Pattern A");

               for(int i = 1; i <= h; ++i)

               {

                   for(int j = 1; j <= i; ++j) {

                       System.out.print("+");

                   }

                   System.out.println();

               }

       System.out.println();

       System.out.println("Pattern B");

               for (int i = 1; i<=h; ++i)

               {

                 for(int j = h; j >=i; --j){

                     System.out.print("+");

                 }

                   System.out.println();

               }

           }

       }

Explanation:

  • The trick in this code is using a nested for loop
  • The outer for loop runs from i = 0 to the heigth of the triangle (in this case 7)
  • The inner for loop which prints the (+) sign runs from j = 0 to j<=i
  • It prints the + using the print() function and not println()
  • In the pattern B the loop is reversed to start from  i = height
You might be interested in
David has created a lot of styles and now his Quick Style Gallery contains styles he no longer uses.
shusha [124]

Answer:

Right-click the style in the Quick Styles Gallery, and select the Remove from Quick Style Gallery option.

Explanation:

3 0
4 years ago
interpret the following SQL create table persons (person I'd int, last name varchar (255) first name varchar (255) address varch
zhuklara [117]

Answer:

Kindly check explanation

Explanation:

The SQL statement above could be interpreted as follows :

create table command is used to create a table named 'persons' with five columns which are labeled :

person I'd : whose data type is an integer

last name column with a variable character data type with maximum length of 255

first name column with a variable character data type with maximum length of 255

address column with a variable character data type with maximum length of 255

city column with a variable character data type with maximum length of 255

The VARCHAR data type is ideal since we expect the column values to be of variable length.

3 0
3 years ago
Should a social network own our social data? Is it an invasion of privacy for social networks to collect and use the information
Svetradugi [14.3K]

Answer:

The description for the given question is described in the explanation section below.

Explanation:

No, we don't even own our identity data on social networking sites. It may be said as permission is needed as an factor for recognizing an acceptable interpretation and solution to a circumstance as well as a method to be followed.

  • They would conclude that, in contemplating the data generated from social networking, this could be recognized that although the data that they left as our electronic fingerprints must be used with applications that can provide the businesses with the appropriate strategy to best reach the consumer.
  • With all this into consideration, the method of information gathering does not include personal identifying information, and also the reality that we must be made mindful of what details has been accessed as well as the right to get out of obtaining such details from the social platform.
3 0
3 years ago
Walter’s health insurance premium increased by 22 percent this year. Now he pays $488 every month for health insurance. What was
ElenaW [278]

Answer:

$380.64

Explanation:

So he what you do is take $488 multiply it by 22% to get $107.36 you then subtract $488 from $107.36 to get what he was paying before premium increase which is $380.64

7 0
4 years ago
Carlos works in the IT department at Sample Bank. He uses a cloud-based e-mail system and has been asked by his manager to estab
vodomira [7]

Answer:

Option (A) i.e., Chargeback is the correct answer to the following question.

Explanation:

In the cloud-computing, Chargebacks is used for the metrics on the e-mail box which is used by the departments or the organizations, by this system, department budgets has been billed for the costs of entertain the department e-mails. It is applied on the expenses of the IT sectors or services for the strategies of the accounting.

Option B is incorrect because billback it is an application that are used in organization for needs to determining the resources of IT.

Option C is incorrect because Showback is the policy that is used by the IT for rise the expenses.

7 0
3 years ago
Other questions:
  • Repetition learning rates are the same for everyone, so there is no need to find an activation and break pattern that works
    12·2 answers
  • Which statement is true
    12·1 answer
  • I don't understand question how do I work it out?
    7·2 answers
  • Which type of graph or chart measures
    15·2 answers
  • To use an imported image, simply drag it from the desktop onto the stage. true or false
    15·2 answers
  • I need help with getting a profile pic
    5·1 answer
  • Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
    9·1 answer
  • Step of opening browser on computer​
    15·1 answer
  • A pcr-based method to detect a specific pathogen in a specimen works by amplifying a ________ that is specific to the prospected
    12·1 answer
  • Television, video, computers, radios, and magazines used by target audiences are all what types of channels?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!