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
The four strokes in a four stroke cycle engine in proper order.
Morgarella [4.7K]

Answer:

A four-stroke cycle engine is an internal combustion engine that utilizes four distinct piston strokes (intake, compression, power, and exhaust) to complete one operating cycle. The piston make two complete passes in the cylinder to complete one operating cycle.

Explanation:

6 0
3 years ago
For a steel alloy it has been determined that a carburizing heat treatment of 11.3 h duration will raise the carbon concentratio
diamong [38]

This question is incomplete, the complete question is;

For a steel alloy it has been determined that a carburizing heat treatment of 11.3 h duration at Temperature T1 will raise the carbon concentration to 0.44 wt% at a point 1.8 mm from the surface. A separate experiment is performed at T2 that doubles the diffusion coefficient for carbon in steel.

Estimate the time necessary to achieve the same concentration at a 4.9 mm position for an identical steel and at the same carburizing temperature T2.

Answer:

the required time to achieve the same concentration at a 4.9 is 83.733 hrs

Explanation:

Given the data in the question;

treatment time t₁ = 11.3 hours

Carbon concentration = 0.444 wt%

thickness at surface x₁ = 1.8 mm = 0.0018 m

thickness at identical steel x₂ = 4.9 mm = 0.0049 m

Now, Using Fick's second law inform of diffusion

x^2 / Dt = constant

where D is constant

then

x^2 / t = constant

x^2_1 / t₁ = x^2_2 / t₂

x^2_1 t₂ = t₁x^2_2

t₂ = t₁x^2_2 / x^2_1

t₂ = (x^2_2 / x^2_1)t₁

t₂ = ( x_2 / x_1 )^2 × t₁

so we substitute

t₂ = ( 0.0049  / 0.0018  )^2 × 11.3 hrs

t₂ = 7.41 × 11.3 hrs

t₂ = 83.733 hrs

Therefore, the required time to achieve the same concentration at a 4.9 is 83.733 hrs

8 0
2 years ago
All of these are uses of microwaves except...
Talja [164]

Answer:D

Explanation:

5 0
3 years ago
Consider this example of a recurrence relation. A police officer needs to patrol a gated community. He would like to enter the g
SashulF [63]

Answer:

the police officer cruise each streets precisely once and he enters and exit with the same gate.

Explanation:

NB: kindly check below for the attached picture.

The term ''Euler circuit'' can simply be defined as the graph that shows the edge of K once in a finite way by starting and putting a stop to it at the same vertex.

The term "Hamiltonian Circuit" is also known as the Hamiltonian cycle which is all about a one time visit to the vertex.

Here in this question, the door is the vertex and the road is the edge.

The information needed to detemine a Euler circuit and a Hamilton circuit is;

"the police officer cruise each streets precisely once and he enters and exit with the same gate."

Check attachment for each type of circuit and the differences.

7 0
3 years ago
Discuss typical advantages and disadvantages of an irrigation system?
trapecia [35]
Advantages include low costs and minimal labor.Water stays in the root zone, and foliage stays dry. Drawbacks to surface irrigation include potential overwatering and wasteful runoff.
4 0
3 years ago
Other questions:
  • A petrol engine produces 20 hp using 35 kW of heat transfer from burning fuel. What is its thermal efficiency, and how much powe
    14·1 answer
  • 4.
    6·2 answers
  • Which of the following describes what occurs when energy is lost in efficient transformation?
    14·1 answer
  • The electricity generated by wind turbines annually in kilowatt-hours per year is given in a file. The amount of electricity is
    5·2 answers
  • One of our wifi network standards is IEEE 802.11ac. It can run at 6.77 Gbit/s data rate. Calculate the symbol rate for 801.11ac
    5·1 answer
  • (TCO 1) Name one disadvantage of fixed-configuration switches over modular switches. a. Ease of management b. Port security b. F
    6·1 answer
  • 12 times the square root of 8737
    13·1 answer
  • Describe the are of mechanical engineering
    6·2 answers
  • The wave-particle duality theory is the first adequate explanation of which one of the following observations about the hydrogen
    10·1 answer
  • Is the pure fission bomb a nuclear bomb?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!