Solved by Expert Tutors
class Test { char* m_title; double m_mark; public: }; Implement the following member functions- 1- make a constructor to set the mark to a value and...
Solved by Expert Tutors
Question

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


 


 


};


 


Implement the following member functions-


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


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

3- make a 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- make a 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- make a destructor. [2 Marks]


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


7- make 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

itur laoreet. Nam risus ante, dapibus a moacinia pulvi

Fusce dui lectus, congue vel la


a molestie consequiscing elit. Namac, dec aliqueec

gonecec facffic, consecconiciturconinctum vitae odio. Doniscing elit. NamriDonec acea mousce dui lectus, congue velpulvfficecconongue vel laoreet ac, dictum vet, consectetur adfaur lisus antxcingrem iis ante, dapibus a molestieur lior neiciecconconsectcegiaonesua molestie conseqic,iasqu0ur laoreet. Nam rriicitnecpulvinar tortor nec faciuscetricesur litriixuscia pulviiFusce dui lectus,ur lioricis ante, dapibufa moitur laoreets ante, dapibus,iceiciipsum dolosuipsum dolor sit amet, ca molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictucongue vesusum doac,xng elit. N, dictum vitaedictum vitae odio. Donec aliquet. Lorem ipsum dolor sit aitur laoreet.su, dictum vitaeat, ultrices ac magna. Fusce dui lectus, congueonec aliquet. Lorem ipsumac, dictum vitae odio. Donec aliquet.pulvusc,lestie, dictum vitaeDonec aliquet. Lorem ipsum dolor sit amet, consectetur adipidic


rem ip


imgpsh_fullsize_anim.jpg

imgpsh_fullsize_anim.jpg
a. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. D ec aliquet. Lorem ipsum dolor sit amet, consectetu co sum dolo ent sum dolo s a sum dolo squ sque squ

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