subject
Engineering, 10.03.2020 08:55 duttonsteven45

Write a CPP program that prompts the user to enter the number of lines and generates the following pattern of stars. If the nonnegative integer is 4, then the pattern generated is:


***
**
*
*
**
***

Also, write a program that prompts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern. For example, specifying 4 as the number of lines generates the above pattern.

main. cpp

#include
using namespace std;

void printStars(int lines);

int main()
{
// prompt the user to enter a number

// call printStars

return 0;
}

void printStars(int lines)
{
// write your star pattern function here
}

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 19:10
An external consultant recommends that a plant installs a bank of capacitors for power factor correction. this will reduce the peak electrical demand charges by an average of 93 kw every month. the plant current pays $13 per kw in peak demand charges. the capacitor bank will include 223 kw of fixed capacitors, and 183 of variable capacitors. the fixed capacitors cost $59 per kw, and the variable capacitors will cost $65 per kw. the consultant charges 21% of the equipment costs to install the capacitors. because this project will reduce the demand for the electric utility, they are prepared to provide a one-time rebate of $42 per kw of reduced demand. what is the simple payback period for this project (in years)?
Answers: 2
question
Engineering, 04.07.2019 19:10
Acircular aluminum shaft mounted in a journal is shown. the symmetric clearance gap between the shaft and journal is filled with sae 10w-30 oil at t 30°c. the shaft is caused to turn by the attached mass and cord. develop and solve a differential equation for the angular speed of the shaft as a function of time.
Answers: 2
question
Engineering, 06.07.2019 03:30
The load on a bolt consists of an axial pull of 10 kn together with a transverse shear force of 5 kn. the bolt material has a yield strength of syt syc 100 mpa. find the diameter of the bolt at factor of safety n-0.5, n 1 and n-2 using maximum shear stress theory
Answers: 3
question
Engineering, 06.07.2019 04:10
Along steel shaft of 10 cm diameter is austenised at 870°c and then quenched in a liquid at 30oc. the average surface heat transfer coefficient is 2000 w/m2. °c. the relevant thermophysical properties of the shaft are: p=7800 kg/m", k=20 w/mk, cp=0.46 kj/kg.k calculate: a)-the time required for the center temperature to drop to 200°c. b)-the temperature at half-radius at that moment. c)-the amount of heat that had been transferred to the liquid by that time per meter length of the shaft
Answers: 1
You know the right answer?
Write a CPP program that prompts the user to enter the number of lines and generates the following p...
Questions
question
English, 28.10.2020 19:30
question
Computers and Technology, 28.10.2020 19:30
question
Chemistry, 28.10.2020 19:40
question
Mathematics, 28.10.2020 19:40
question
English, 28.10.2020 19:40
Questions on the website: 13722359