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 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
question
Engineering, 04.07.2019 18:10
Water at the rate of 1 kg/s is forced through a tube with a 2.5 cm inner diameter. the inlet water temperature is 15°c, and the outlet water temperature is 50°c. the tube wall temperature is 14°c higher than the local water temperature all along the length of the tube. what is the length of the tube?
Answers: 3
question
Engineering, 04.07.2019 18:10
Machinery that is a key part of the process and without which the plant or process cannot function is classifed as: (clo4) a)-critical machinery b)-essential machinery c)-general purpose machinery d)-none of the specified options.
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
Mathematics, 08.01.2020 07:31
question
Mathematics, 08.01.2020 07:31
question
Business, 08.01.2020 07:31
question
Mathematics, 08.01.2020 07:31
question
Biology, 08.01.2020 07:31