I need help filling in the part in red in the following code, as Ihave no idea w
ID: 3613387 • Letter: I
Question
I need help filling in the part in red in the following code, as Ihave no idea what I should use to complete this small script:-------Code-----------
Hi,
I need help trying to solve the basic computer program below, I'mjust confused on what I should use and why I should sue it. It'sbeen a while since I had to code something, so I somewhat need arefresher.
I will definitly rate lifesaver!
----------CODE BELOW-------------
/* 2170_1_4.cc
Problem description: Write a program to read an integer n (1<=n<=9)
from screen and print the following output:
1
22
333
4444
55555
...
nnnnn...nn
The last line contains n digits of n where n is between 1 to 9.
*/
#include <iostream>
using namespace std;
int main( )
{
int n; //the bottom size of the triangle
int lineNO; //keep track of the working line number
cin >> n; // read the size of the triangle
while ( n<=0 || n>9 )
{
cout << "Please input an integer between 1 and 9" << endl;
cin >> n;
}
cout << "Output: " << endl;
WRITE YOUR CODE HERE TO MAKE IT WORK OR TOFINISH IT
return 0;
}
-----------------END OF CODE----------------------------
Explanation / Answer
please rate - thanks some minor changes were made #include using namespace std; int main( ) { int n=-1; //the bottom size of the triangle int lineNO; //keep track ofthe working line number int i; //cin >> n; // read the size of the triangle commented out while ( n9 ) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.