Get premium membership and access questions with answers, video lessons as well as revision papers.

Create a C++ class called line that draws a line on the screen.Store the line length in a private integer variable called len.Have line's constructor...

      

Create a C++ class called line that draws a line on the screen.Store the line length in a private integer variable called len.Have line's constructor take one parameter: the line length.Have the constructor store the length and actually draw the line .If the system does not support graphics, display the line by using *. Give the line a destructor that erases the line.

  

Answers


Davis

#include
using namespace std;
class line {
int len;
public:
line(int 1);
};
line::line(int 1)
{
len = 1;
int i;
for(i=0; i}
int main()
{
line 1(10);
return 0;
}

Githiari answered the question on May 12, 2018 at 16:30


Next: Why might the following function not be in-lined by the computer' s compiler void f1() { int i; for(i=0; i<10; i++) cout <
Previous: 
What does the following program display? #include using namespace std; int main() { int i = 10; long 1 = 1000000; double d = -0.0009; cout << i << ' ' <<1<<...

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions