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]
3 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]3 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
Edhesive unit 4 test
sergij07 [2.7K]

Answer:

padna jana ta yarrr kasto this yarr

8 0
2 years ago
How do I write this code in java? input "Enter Your Age to Order a Beer"
Klio2033 [76]

Answer:

i dont know sorry but answer above lol

Explanation:

5 0
2 years ago
According to the order of operation in Excel: a. Excel performs exponentiation, then multiplication, then division, then subtrac
Ilya [14]

Answer:

Option is b is correct answer. Excel performs exponentiation, then multiplication and division, then addition, and subtraction, it is correct order of operation in Excel. It is important to remember when you write any formula in Excel having different mathematical operators like +/ -/ ^/  etc, it follows a specific order and performs calculations in specific order which is termed as order of operator precedence. Each of mathematical operator has its precedence and executes in a special order set by Excel.

Explanation:

  • As we already know order of precedence of each mathematical operator is different in Excel. The order of operations for Excel is as follows:

  • Evaluate elements in parentheses.
  • Evaluate 'ranges' ().  
  • Evaluate 'intersections' (empty spaces).  
  • Evaluate 'unions' (,).
  • Perform negation (-).  
  • determine percentages (%).  
  • Perform exponentiation (^).  
  • Perform multiplication (*) and division (/), both are of equal precedence.  
  • Perform addition (+) and subtraction (-), both are of equal precedence.  
  • Evaluate text operators like (&).  
  • Perform comparisons like (=, <>, <=, >=).

 

Answer details  

Grade: Middle

Subject: Computers and Technology

Chapter: Order of precedence of mathematical operators

Keywords: precedence in Excel, operators precedence etc

7 0
3 years ago
Which of the following computer component facilitates internet connection?
babunello [35]

Answer:

your answer may be(utility software)

8 0
2 years ago
Read 2 more answers
Which command group on the Slide Master tab is used to add headers, footers, and other placeholders to the slide
Vikki [24]

Answer:D

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
    6·2 answers
  • What is the full form of bcc please tell​
    15·2 answers
  • List three tacos there are several from the opening page of the help and support center.
    5·1 answer
  • __________ is a growing practice in cooperative farmingassociations to pool and sell the fruit as a common commodity underthe br
    6·1 answer
  • The method needed to arrange for an object to be notified when a window's close-window button has been clicked is
    6·1 answer
  • Sara Beth and Taylor have developed a new software that they plan to distribute for free, allowing other software professionals
    7·1 answer
  • What is a characteristic of maintaining logs in a system? A. Logging prevents security violations, but only deals with passive m
    10·1 answer
  • Name all mario kart games in order
    15·2 answers
  • Question 2 of 3
    7·2 answers
  • What are the small squares that appear in the corners and in the middle of the sides of a selected object's border called?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!