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
Since you became discouraged not being able to find a job in the San Diego area, you enlarged the area in which you looked for a
nordsb [41]

Answer:

need points 48986

Explanation:

5 0
3 years ago
11. Ten bagels is what percentage of a dozen bagels?
IRINA_888 [86]

Answer:

the answer is d 83.3%

Explanation:

3 0
3 years ago
Select the correct answer. Jennifer, a construction manager at a construction firm, has to hire several contractors and subcontr
Ymorist [56]
A. Quality management
7 0
3 years ago
Read 2 more answers
What is the volicity of a rocket?
Marysya12 [62]

Answer:

7.9 kilometers per second

Explanation:

8 0
2 years ago
Read 2 more answers
A study of online dating found that when including emoticons in their profiles, response rates for female users _______ by _____
Dvinal [7]

Answer:

Increased, 5%

Explanation:

Recent studies conducted on online dating sites established that the response of female users increased by 5% when emotions are in their profiles even as for male users' response also increased by 8%. Another study also revealed that those who have never used online dating sites and/or mobile dating apps believe that people who use dating apps are desperate.

8 0
3 years ago
Other questions:
  • Air is compressed in the compressor of a turbojet engine. Air enters the compressor at 270 K and 58 kPa and exits the compressor
    13·1 answer
  • One kilogram of water contained in a piston–cylinder assembly, initially saturated vapor at 460 kPa, is condensed at constant pr
    15·1 answer
  • 6.3.3 Marks on an exam in a statistics course are assumed to be normally distributed
    14·1 answer
  • List and explain the major features that the following building designs must have to relate directly to their functions.
    11·1 answer
  • Incremental software development could be very effectively used for customers who do not have a clear idea about the systems nee
    5·1 answer
  • Risks are Not Perceived Differently from What is Happening<br> False<br> True
    14·1 answer
  • The density of a certain type of steel is 8.1 g/cm3. What is the mass of a 100 cm3 chunk of this steel
    10·1 answer
  • As you push a toggle bolt into a wall, the
    13·1 answer
  • Thermal energy measured by?
    12·1 answer
  • When bending metal, the material on the outside of the curve stretches while the material on the inside of the curve compresses.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!