Đã hoàn thành

c++ problem involving pointers and classes

Need done in less than an hour!

Use the following code segment for your answers to the questions below:

template< class T >

class Mystery

{   public:


       T *what1;

       T *what2;

       int size;  // The size is for the two arrays(what1 and what2).


int main( )

{   const int SIZE = 5;

   int grades1[ ] = { 100, 90, 87, 89, 60}; // LINE 1

   int grades2[ ] = { 98,56,90,90,100}; //LINE 2

   Mystery < int > object1( grades1, grades2, SIZE); // LINE 3

   cout << object1[3] << endl; // LINE 4

   return 0;



1. The code on LINE 3 in the main is supposed to copy all array elements of grades to the *what that is used as an array.   ( 5 points)

What is missing in the class Mystery? Come up with the implementation inside the class.

2. Come up with the implementation inside the class to make the code on LINE 4 work when executed in a complete program.  (3 points)

3. Where should you delete the pointers of the class?  Modify the class.  (2 points)

4.  What should be done to the main ( ) if the main contains the following statement below LINE4 ?   ( 2 points)

   Mystery < double > object2( grades4, grades5, SIZE);

Kĩ năng: Lập trình C++

Xem nhiều hơn: which software is used to make 3d animation, what is c programming used for, pointers in c programming, pointers c programming, online c++ program classes, josephus problem in c using array, does c have classes, c++ programming problem, c programming pointers, c# programming from problem analysis to program design pdf, c# programming from problem analysis to program design, c programming classes, c code for assignment problem, assignment problem in c language, app used to make graphic designs, online c programming classes, c# android / vb net web service problem, c android vb net web service problem, complete program classes, illustrate process used deal specific problem difficult situation

Về Bên Thuê:
( 3 nhận xét ) West Richland, United States

ID dự án: #12193350

Được trao cho:


Hello, my name is Kostas and I am an expert c/c++ developer with an extensive knowledge of algorithms and data structures. I can have your program ready within an hour. Please send me a message to discuss the de Thêm

$30 USD trong 0 ngày
(15 Đánh Giá)

3 freelancer chào giá trung bình$23 cho công việc này


hello,how are you. i read your bid carefully. i am c/c++ expert and have full experience for 10 years. c++ language is my top skill. i can provide most quality and high speed. if you want to success, please contact Thêm

$25 USD trong 1 ngày
(9 Nhận xét)

Hello, sir. I have read your project description in details. I have enough experiences with your required skills. I have worked as software developer in desktop with C, C++, C#, java. And in .NET & ASP.NET and Data Thêm

$25 USD trong 1 ngày
(1 Nhận xét)

I have looked at it and can help you out. Let me know if you are interested on my bid. ......................

$15 USD trong 1 ngày
(27 Nhận xét)