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
Which of the following symbols is a part of all spreadsheet functions?
NARA [144]

Answer:

the answer is B and is part of all spreadsheet functions

8 0
3 years ago
Read 2 more answers
1. Who was able to complete the puzzle the fastest in Trial 1?
KATRIN_1 [288]

Answer:

You...answered all of the questions.

Explanation:

All of them have a response!

8 0
3 years ago
What is the abuse of electronic messaging systems to indiscriminately send unsolicited bulk messages, many of which contain hoax
Ilya [14]

I think the answer is spam
5 0
2 years ago
A USB is used for _________.[ pick the best answer that makes sense]
Nookie1986 [14]
<span>B) storing information and documents, pictures</span>
4 0
3 years ago
Read 2 more answers
Smartphones can have virtual keyboards or physical keyboards. What are 3 advantages and disadvantages to each one?
masha68 [24]
Advantages to virtual keyboards:
- You have easy shortcuts
- Cooler emojis <span>
- And we have google voice (or Siri) with a click of a key
Disadvantages to a virtual keyboard: 
- It is very easy to send something you don't want to send by     
     accidentally touching the send button
-  It is harder for people with big hands to use
-  </span>typing speed will likely be negatively impacted on a virtual keyboard<span>.
</span>
Advantages to using a physical keyboard:
- <span> The keyboard takes up no space on the front panel or on the display area.
</span>- <span>you are making use of muscle memory, which increases your speed
</span>- Typing on a touchscreen requires an on-screen keyboard, which lacks the tactile response of a real keyboard.

Disadvantages to using a physical keyboard:
- <span>For the average consumer, phones with a physical keyboard are a bit bulkier.</span>
- Most phones with a physical keyboard have to be designed a certain way to minimize space and increase efficiency.
- I<span>t is a slow method when you need to write a long piece of writing when there are faster ways such as scanning and dictation</span>
5 0
3 years ago
Other questions:
  • Consider a relation representing the present position of molecules in a closed container. The attributes are the ID for the mole
    12·1 answer
  • You're working at a large industrial plant and notice a tag similar to the one shown in the figure above. Which of the following
    5·1 answer
  • What is the most efficient way to include a space after each paragraph?
    13·2 answers
  • list the network characteristics of the wireless network(s) in the decode -- SSIDs, channels used, AP names, presence of Bluetoo
    6·1 answer
  • Xml is used to format the structure and style of a web page. true or false
    7·1 answer
  • When talking about the physical elements of the internet, the term redundancy refers to:?
    13·1 answer
  • Can you block someone on Brainly?
    7·2 answers
  • Heather has segmented all of the individuals in her database into four categories according to how many game tickets they purcha
    12·2 answers
  • A _______________ is a security threat that may launch a worm through a Trojan horse or launch a denial-of-service attack at a t
    10·1 answer
  • Give four advantages for ssd compared to hdd
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!