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
GenaCL600 [577]
3 years ago
8

I don't understand how to write code for this in Java using nested for loops only. The official question is: write a program tha

t produces the following hourglass figure using nested for loops?

Computers and Technology
1 answer:
Bingel [31]3 years ago
4 0

Answer:

public class Triangle

{

public static void main( String[] args )

{

show( 5 );

}

public static void show( int n )

{

int i,j,k;

for (i = 0; i < n - 1; i++ )

{

for (j = 0; j < i; j++ )

{

System.out.print( " " );

}

for (k = n - i; k > 0; k-- )

{

System.out.print( "* " );

}

System.out.println();

}

for (i = 0; i < n; i++ )

{

for (j = n - i; j > 1; j-- )

{

System.out.print( " " );

}

for (k = 0; k < i + 1; k++ )

{

System.out.print( "* " );

}

System.out.println();

}

You might be interested in
A computer is defined by 4 specific criteri. Select all 4.*
VikaD [51]

Answer:

Explanation:

Receive input, produce output, store information, process information

8 0
3 years ago
________ are found on the motherboard and are used to attach your hard disk.
Naya [18.7K]
<span>SATAs are found on the motherboard and are used to attach your hard disk.
</span>The SATA standard is most often used today by hard drives to communicate with a system motherboard. SATA stands for <span>Serial AT Attachment.
</span>It is a computer bus<span> interface that connects </span>host bus adapters<span> to </span>mass storage devices<span> such as </span>hard disk drives<span>, </span>optical drives<span>, and </span>solid-state drives<span>.</span>

4 0
3 years ago
Identify when programmers use an Else statement.
Gnesinka [82]

Answer:

to tell the program to take a different action when the If statement answer is false

Explanation:

if x = 0:

     print('x equals 0')

else:

      print('x equals something else that isnt 0')

4 0
3 years ago
Read 2 more answers
Please Help Me!!!!!!!!!!!!!
My name is Ann [436]

Explanation:

a magazine cause it helps put out commercial

3 0
3 years ago
Which terms means device that converts one voltage to another ?
Jet001 [13]

Answer:

I believe it is an adapter

Explanation:

An adapter or adaptor is a device that converts attributes of one electrical device or system to those of an otherwise incompatible device or system. Some modify power or signal attributes, while others merely adapt the physical form of one connector to another.

6 0
2 years ago
Other questions:
  • In hunter-gather societies most hunting was done by
    9·2 answers
  • Credibility means that the reader perceives value in what you write.<br> True False
    12·1 answer
  • What keyword do we use when instantiating an object _________________
    15·1 answer
  • A CPU has 32 KB cache, 2-way set associative, 16-byte block size. How many bits are required to use index each set in this cache
    6·1 answer
  • The arguments in a method call are often referred to as ____ . The variables in the method declaration that accept the values fr
    10·1 answer
  • Să se determine valoarea sumei: l+2+3+…+n pentru un n număr natural citit de la tastatură. Sa se scrie un algoritm care calculea
    13·1 answer
  • Phishing (pronounced fishing) is malware sent through e-mail that looks like a legitimate message from a trusted sender. The goa
    10·2 answers
  • Alfred works in the human resources department, and he uses a management information system to find applicants' résumés on the w
    7·1 answer
  • Means storing,accessing information over the internet other than hard drive and your system
    15·1 answer
  • Refer to the exhibit. Host B on subnet Teachers transmits a packet to host D on subnet Students. Which Layer 2 and Layer 3 addre
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!