Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

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

Answer Attachments

Exams With Marking Schemes

Related Questions