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

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


Next:  Discuss the use of geographical grouping.
Previous: Using the following class declaration, create a ten-element array, initialize num to the values 1 through 10, and itialize sqr to num's square. #include using namespace...

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


Learn High School English on YouTube

Related Questions