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
Novay_Z [31]
4 years ago
12

Given an int variable n that has already been declared and initialized to a positive value, write a Java program that prints the

reverse triangle of asterisks with n asterisks on the first line (top of triangle), one less asterisk on the next level, and so on till 1 asterisk on the bottom level. (All asterisks aligned on the left, not centered in the middle, so you don’t need blanks. But think how you would have solved this problems if you’d need to center the triangle!)
Computers and Technology
1 answer:
Mars2501 [29]4 years ago
6 0

Answer:

The program to this question can be given as:

Program:

public class Main //define class.

{

public static void main(String[] as) //define main method.

{

int n=5; //define variable n and assign positive value.

int i,j; //define variable

for (i = 7; i>=1; i--) //outer loop.

{

for (j = 0; j< i; j++) //inner loop.

{

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

}

System.out.println(); //line break.

}

}

}

Output:

*****

****

***

**

*

Explanation:

The description of the above code can be given as:

  • In the above java programming code firstly we define a class that is "Main". In this class we define a main method in the main method we define a variables that is "n" in this variable we assign a positive value. The we define another integer variable that is i,j this variable is used in the loop.
  • Then we define a loop. for prints asterisks values in reverse triangle, we nested looping concept. In nested looping, we use in loop in this loop we use the i and j variables that print the asterisks value.

You might be interested in
Marie can now edit her photos, send them in emails, print them on a printer, and use them as wallpaper on her computer. This is
AVprozaik [17]

I could be wrong, but I believe this one would be JPG files.

4 0
4 years ago
Read 2 more answers
What are some pros and cons of being a Computer Hardware Engineer?
olganol [36]
Pros: Median salary is high (about $108,430), Employable in many different industries, like product manufacturing, computer systems design and scientific research.
Cons: Limited job growth, often requires long hours.
8 0
4 years ago
The title element in the head section of an HTML document specifies the text
bagirrra123 [75]

Answer: c. that's displayed in the title bar of the browser

Explanation:

The title element in the html write up is used to describe the title of the work that is been carried out.

It has the format <title></title>, the title name is indicated between the opening and closing title tag.

The title does not display on the main page of the Web user's display, but it can be seen on the title bar of the Web browser.

The title element help Web user to have an idea of what a Web page is about.

7 0
3 years ago
N the following pseudocode, what percentage raise will an employee in Department 8 receive?
goldenfox [79]

Answer:

"MEDIUM_RAISE" is the correct answer for the above question.

Explanation:

  • In the above pseudo-code, The first if statement will false because the question suggests that the department value is 8, which is greater than 5. But the first if statement states that the department value is less than 5.
  • Then the else-if statement gets checked which gives the true result. It is because the value of the department variable is 8, which is less than 14.
  • So the else-if statement block will be executed which assigns the MEDIUM_RAISE value to the raise.
  • Hence the answer is "MEDIUM_RAISE".

4 0
3 years ago
Remember to check the on your vehicle first to see if a repair is covered by the manufacturer.
krok68 [10]

Answer:

insurance or warranty

Explanation:

It should be insurance because insurance can cover things like car repairs and other things that goes wrong. warranty could work too because it kind of means the same thing.

5 0
4 years ago
Other questions:
  • Professional photography is a competitive job field. <br> true <br> false
    12·2 answers
  • Dead state is the name of the time delay in a cpu caused by differences between the speed of the cpu and ram.
    15·1 answer
  • Brian is selecting an authentication protocol for a PPP connection. He would like to select an option that encrypts both usernam
    7·1 answer
  • What was the best Metal Gear Solid you enjoyed the most?​
    6·1 answer
  • What is an example of CT SO?
    9·1 answer
  • WILL GIVE BRAINLIEST
    15·1 answer
  • How can having more than one goal cause truble in the work place
    6·1 answer
  • Write a program that creates a two-dimensional array initialized with test data. Use any data type you wish. Declare a two-dimen
    9·1 answer
  • 1. Complete the following program so that it computes the maximum and minimum of the elements in the array. Write the program so
    6·1 answer
  • Here is what my rob-lox user USED to look like, btw what is better, Samsung or apple?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!