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.

Using the following class declaration, create a ten-elment array and initialize the ch element with the values A through J. Demonstrate that the array does,...

Using the following class declaration, create a ten-elment array and initialize the ch element with the values A through J. Demonstrate that the array does, indeed, contains these value.
#include
using namespace std;
class letters {
char ch;
public:
letters (char c) { ch = c; }
char get_c) { return ch;}
};

Answers


Davis
#include
using namespace std;
class letter {
char ch;
public:
letter (char c) {ch =c;}
char get_ch() {retu}
};
int main() {
letter ob[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
int i;
for(i=0; i<10; i++)
cout << ob[i] get_ch';
cout << "\n";
return 0;
}
Githiari answered the question on May 31, 2018 at 17:24

Answer Attachments

Exams With Marking Schemes

Related Questions