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
ss7ja [257]
3 years ago
6

3) Write a program named Full_XmasTree using a nested for loop that will generate the exact output. This program MUST use (ONLY)

for loops to display the output below. For example the 1st row prints 1 star 2nd row prints 2, the 3rd row print 3 stars and so forth... This program is controlled by the user to input for the amount of row. "Prompt the user to enter the dimensions of the tree" A good test condition is the value of ten rows. (hint***)This program should account for white spaces print("* "). Remember the purpose of print() and println()

Computers and Technology
1 answer:
N76 [4]3 years ago
8 0

Answer:

Following are the code to this question:

//import package

import java.util.*;  

public class Full_XmasTree   //defining class

{        

// defining main method

public static void main(String as[])  

   {  

       int X,a,b; //defining integer variable

       Scanner obx = new Scanner(System.in); // creating Scanner class object

       System.out.print("Please enter: "); //print message

       X = obx.nextInt(); // input value from user

       for (a = 0; a < X; a++) //defining loop to print pattern  

       {

           for (b = X - a; b > 1; b--)//use loop for print white space  

           {

           System.out.print(" ");//print space

           }

           for (b = 0; b <= a; b++) // use loop to print values  

           {

               System.out.print("* "); //print asterisk values

           }

           System.out.println(); //using print method for new line

       }

   }

}

Output:

please find the attachment.

Explanation:

In the given java code, a class "Full_XmasTree" is declared, in which the main method is declared, inside this method three integer variable "X, a, and b", in this variables "a and b" is used in a loop, and variable X is used for user input.

  • In the next line, the Scanner class object is created, which takes input in variable X, and for loop is used to print asterisk triangle.
  • In the first for loop, use variable a to count from user input value, inside the loop, two for loop is used, in which first is used to print white space and second is used for the print pattern.

You might be interested in
1. When adding text to an Excel worksheet, which option displays the Word window features? A. Text box B. There are no options t
shepuryov [24]
I'm gonna say A, hope it's right.
6 0
4 years ago
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
lyudmila [28]

I am not able to open the pdf kindly send the jpg form.

4 0
3 years ago
Read 2 more answers
Jamie is using the UNIX file system to work on his computer. He puts a dot before the file extension to separate it from the fil
NARA [144]

Answer: as a file extension

Explanation:

4 0
4 years ago
Read 2 more answers
. Explain the notions of WAN, LAN, MAN and PAN.
qaws [65]

Answer:

Explanation:

  1. WAN (Wide Area Network), is a computer network that joins several local networks, although their members are not all in the same physical location.
  2. LAN (Local Area Network) is a network of computers that cover in a small area for example a house, an apartment or a building. One part of the topological definition is the physical topology, which is the actual arrangement of the cables or media.
  3. MAN (metropolitan area network) is a network of computers that interconnects users with computer resources in a geographic area or region larger than area covered by a large local area network (LAN)
  4. PAN (Personal Area Network.) Is a network used to connect different personal computer devices centered on an individual person workspace.
4 0
3 years ago
Which mark is an indicator of invalid data in a cell?
Snowcat [4.5K]

Answer:

A.) red circle around the value

Explanation:

Just did the Assignment on Edge 2021

Plz click the Thanks button!

<Jayla>

4 0
3 years ago
Other questions:
  • What is the on board storage C:
    15·1 answer
  • What are operational databases
    12·1 answer
  • Servers that manage only one type of resource are called ____ servers.
    6·1 answer
  • Why is it necessary to understand conflict of interest and how it could affect you at work​
    7·1 answer
  • Burtex Inc. is an application development organization. Twenty five of its knowledgeable employees are retiring in the upcoming
    6·1 answer
  • A constructor: A. always accepts two arguments B. has return type of void C. has the same name as the class D. always has an acc
    9·1 answer
  • it has been said that television has little real educational value. what is your opinion on this issue?
    11·1 answer
  • What is the advantage of using a translation look-aside buffer (TLB), also called associative memory, in the logical-physical ad
    15·1 answer
  • THERES THIS USER ON HERE WHO IS TAKING ALL YOUR POINTS SO I DID THE SAME THING TO HER CUZ SHE DID IT TO ME...SO WHY DONT WE ALL
    5·1 answer
  • Please help me answer this question
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!