Solved by Expert Tutors
Hints: class Test { char* m_title; double m_mark; public: }; Question 1- constructor to set the mark to a value and initialize the title to nullptr.
Solved by Expert Tutors
Question

Hints: class Test {   char* m_title;   double m_mark; public:


};


Question

 


1- constructor to set the mark to a value and initialize the title to nullptr. [3 Marks]


2- subtract function to reduce the mark by a received value. [2 Marks]

3- constructor to set the mark (first argument) and the title (second argument) to values. 

Note that the title is a C-style string and has a dynamic size. [4 Marks]


4- member function to print the Test as follows: Title in 30 spaces left justified and mark in 5 spaces

 with one digit after the decimal point. [4 Marks]


5- destructor. [2 Marks]


6- set function to set the title to a new value. [3 Marks]


7- a add function to add one to the mark. [2 Marks]


Assume that this code will compile using the GNU g++ compiler on the matrix. Make


sure that your implementation does not create memory leaks

Step-by-step answer

, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscinacinia pulvi

molestie c


Capture.PNG


Fusce dui lectus, congue vel

Capture.PNG
r

Subscribe to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question