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
Please help ASAP!
makkiz [27]
B. training is the correct answer
8 0
2 years ago
Macy reviewed Steve's presentation. Images in the slides were distracting from the presentation. What advice should
murzikaleks [220]
From what i learned from school, have a theme for the presentation and only have 1-3 pictures per slide that aren’t too big but small enough so you can read and see, also pictures that are self explanatory
8 0
3 years ago
Read 2 more answers
Is the computer a device that calculates and has the independence and initiative for the actions it performs?
inna [77]

Answer:

The answer is "True".

Explanation:

In this question, the given statement is true because the computer is a device that receives information as input, analyzes information utilizing a program that provides relevant information for the processed data, and in this, it performs numerous calculation and all the calculation will be store in its memory, which is used in the future for collect data on hard drives.

8 0
3 years ago
Determine whether the compound condition is True or False.
Vlada [557]

The  compound condition are:

  • 7<12 or 50!=10 is false
  • 7<12 and 50<50 is false
  • not (8==3) is true

<h3>What is compound condition?</h3>

A compound statement is known to be one that shows up as the body of another statement, e.g. as in if statement.

The  compound condition are:

  • 7<12 or 50!=10 is false
  • 7<12 and 50<50 is false
  • not (8==3) is true

Learn more about compound condition  from

brainly.com/question/18450679

#SPJ1

8 0
1 year ago
An intruder with malicious intent breaks into an office and steals a hard drive
kakasveta [241]

Answer: data security

Explanation:

The company's authentication protocols and data encryption measures denotes data security.

Data security simply means protecting unauthorized people from having access to a particular data. This is done to prevent unauthorized access of important information or to prevent fraud. Some of the data security measures include data encryption, tokenization, hashing, etc.

4 0
3 years ago
Other questions:
  • Machine language library routines are installed on computers Select one: a. because they can come as part of the operating syste
    15·1 answer
  • Which technology enables afloat forces to communicate more securely and to operate in a more dispersed manner?
    6·1 answer
  • Sum.Write a program that prompts the user to read two integers and displays their sum.Your program should prompt the user to rea
    11·1 answer
  • January 16, 2018 Q1: This question is worth 99 points and a brainliest. It is a one part question. Medium difficulty.
    5·2 answers
  • What occurs when you call a method on a reference variable that contains null? Select one: a. An ArrayIndexOutOfBoundsException
    11·1 answer
  • In the Unified Process (UP), related activities are grouped into UP ____. a. Services b. Disciplines c. Cycles d. Practices
    11·1 answer
  • Write a program that reads a person's first and last names, separated by a space. Then the program outputs last name, comma, fir
    9·1 answer
  • Help meee pleaseeee
    5·1 answer
  • What does NOT match with Agile Manifesto?
    9·1 answer
  • Answer the following question in 3-4 complete sentences. Define the following terms: - registration - press - keyblock.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!