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
mestny [16]
3 years ago
8

) Write the code to display the content below using user input. The program Name is Half_XmasTree. This program MUST use (ONLY)

for loops to display the output below from 10 to 1 therefore ...1st row prints 10 star 2nd row prints 9… 3rd print 8 stars and so forth... This program is controlled by the user to input the amount of row. A good test condition is the value of ten rows. The user will demand the size of the tree. Remember the purpose of print() and println()

Computers and Technology
1 answer:
harina [27]3 years ago
4 0

Answer:

Following are the program in java language that is mention below

Explanation:

import java.util.*;  // import package

public class Half_XmasTree // main class

{

public static void main(String args[])  // main method

{

int k,i1,j1; // variable declaration  

Scanner sc2=new Scanner(System.in);   // create the object of scanner

System.out.println("Enter the Number of rows : ");

k=sc2.nextInt(); // Read input by user

for(i1=0;i1<k;i1++)  //iterating the loop

{

for(j1=0;j1<i1;j1++)  // iterating the loop

System.out.print(" ");

for(int r=k-i1;r>0;r--)  //iterating loop

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

System.out.println();

}

}

}

Output:

Following are the attachment of output

Following are the description of program

  • Declared a variable k,i1,j1 as integer type .
  • Create a instance of scanner class "sc2" for taking the input of the rows.
  • Read the input of row in the variable "K" by using nextInt() method .
  • We used three for loop for implement this program .
  • In the last loop we print the * by using system.println() method.

You might be interested in
Identify the most appropriate way to display the following research data.
VMariaS [17]

Answer:

1. Artwork of the child participants can be displayed as Picture.

Explanation:

The Art work is painting and filling different colors in different images and objects. Child make different pictures of homes, objects, fruits and vegetables and then colored them accordingly. This type of art work is displayed as picture. This work could not be displayed in the form of tables and lists and also could not shown as graphics.

Answer:

2. The changing image of public transportation is displayed as Graphics.

Explanation:

In Graphics, different images has been designed on different tools by graphic designers to display some problem and its solution in visuals. Different tools are there to make visuals. Changing image of bus transportation is also a transition from old transport system to new transportation system. So, it should displayed in the form of graphics.

Answer:

Illustrative comparison of data from the year 2010-2013 can be displayed in the form of word tables and lists.

Explanation:

In tables and list different data has been placed in specific order for the purpose of analysis of data. These tables are also designed to compare different values and things. So, the data from the year 2010-2013 can be displayed in the form of tables and list so that it can be compared and analyze from different aspects.

7 0
3 years ago
In Linux, when logged in as a normal user with root privileges, which command must precede the apt-get command in the command li
siniylev [52]

Answer:

"sudo" is the command to get super user or root privileges in linux.

Explanation:

in order to install package with root privilege in linux, the command would be

sudo apt-get install <package name>

8 0
2 years ago
A search for reliable information is a search for what?
Nadusha1986 [10]

Answer:

For information you can trust

Explanation:

8 0
3 years ago
What is the iterative procedure of recursive and nonrecursive?
DanielleElmas [232]

Answer:

nonrecursive

Explanation:

3 0
2 years ago
Jake was working on an essay for his English class on a stormy Sunday afternoon. Before he could save his document, a big strike
matrenka [14]

Maybe in atosave, Computers mostly save what your working on :3

8 0
3 years ago
Other questions:
  • In the following statement:
    12·1 answer
  • Prove that for every nfa with an arbitrary number of final states there is an equivalent nfa with only one final state. Can we m
    8·1 answer
  • 1. Why is it important to compare features of a computer before making a purchase?
    13·2 answers
  • Write a program that ask the user to enter air water or Steele and the distance that a sound wave will travel in the medium the
    6·1 answer
  • Privacy settings allow account owners to decide who can ........
    12·2 answers
  • Computer hardware without computer software is useless while computer software without computer hardware is meaningless. Discuss
    10·1 answer
  • Cisco has created a proprietary layer 2 protocol used to manage VLAN configuration between switches called:________a. VLAN Confi
    11·1 answer
  • My sister put my phone in the microwave and I'm pretty sure the battery blew up. I'm too scared to open the microwave. What do I
    11·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • How does the computer help me with school work
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!