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
Sonja [21]
3 years ago
10

Write a function called pyramid(height) that acceptsa parameter ""height"". It then prints a pyramid of that height

Engineering
1 answer:
vichka [17]3 years ago
5 0

Answer:

I am writing a function in C++                              

Explanation:

<h2>C++ program</h2>

#include <iostream>

using namespace std;

int pyramid(int height) // function pyramid with parameter height

{int distance; //variable for spaces

   for(int i = 1, j = 0; i <= height; ++i, j= 0)  //handle the rows

   {

for(distance= 1; distance<= height-i; ++distance)

// handles the spaces & columns

    { cout <<"  ";        } //prints spaces between stars

       while(j!= 2*i-1)  //handles shape and spaces

       {   cout << "* "; // printing stars

           ++j;        }

       cout << '\n';    }   } // for the next line

int main()

{

int height; //declare height variable

cout <<"Enter height of pyramid "; //asks user to enter height of pyramid

cin>>height; //stores value of height

pyramid(height); //calls pyramid function

}

You might be interested in
How do you determine when a truss will fail?<br> (Yield Stress)
Marat540 [252]

Answer:

If a truss buckles or overturns, it is usually because of the failure of an adjacent truss or its bracing. A steel truss in a fire may buckle and overturn because of expansion or weakening from the heat. Most truss failures are the result of broken connections. Photo 1 shows a set of parallel-chord wood trusses supporting a plywood floor deck.

Explanation:

7 0
3 years ago
How can I draw this image in 2D form
Ket [755]

Answer:

no it is not 2D

Explanation:

it is 3D

ok so follow these steps

- make hole

-make square

-make triangle

ok now your figure is ready

5 0
2 years ago
: Câu nào dưới đây thể hiện sự thiếu tự chủ?
sukhopar [10]

Answer:

thành thật mà nói bởi vì cách những chiếc lá đang chuyển và cách mặt trời chiếu sáng.

3 0
3 years ago
Can someone draw a electric circuit with electrical symbols for this
erastovalidia [21]

Answer:

i cant draw it

i am sry

Explanation:

4 0
3 years ago
Read 2 more answers
Interpret the assembly program below: MOV R3,R0;
Reika [66]

Answer:

Explanation:

1.  With the operands R0, R1, the program would compute AND operation and ADD operation .

2. The operands could truly be signed 2's complement encoded (i.e Yes) .

3. The overflow truly occurs when two numbers that are unsigned were added and the result is larger than the capacity of the register, in that situation, overflow would occur and it could corrupt the data.

 When the result of an operation is smaller in magnitude than the smallest value represented by the data type, then arithmetic underflow will occur.

7 0
3 years ago
Other questions:
  • Primary Creep: slope (creep rate) decreases with time
    10·1 answer
  • Vehicles arrive at a single toll booth beginning at 8:00 A.M. They arrive and depart according to a uniform deterministic distri
    9·1 answer
  • What are the two safety precautions taken before driving a car​
    12·1 answer
  • A torsion member has an elliptical cross section with major and minor dimensions of 50.0 mm and 30.0 mm, respectively. The yield
    10·1 answer
  • Counter argument for why engineers dont make a positive change in the world.​
    6·1 answer
  • The beam is supported by a pin at A and a roller at B which has negligible weight and a radius of 15 mm. If the coefficient of s
    7·1 answer
  • Both equilibrium equations and constitutive models are needed to solve statically indeterminate problems. a)- True b)-False
    13·1 answer
  • Two sites are being considered for wind power generation. On the first site, the wind blows steadily at 7 m/s for 3000 hours per
    5·1 answer
  • CAD(computer-aided design) software and is used in__________and __________that show how to construct an object. Technical drawin
    15·1 answer
  • The A/C compressor will not engage when the A/C is turned on. The static refrigerant pressure is 75 psi and the outside temperat
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!