Question: Create a Class and the Class has the following: Name a String of maximum 50 characters if upon construction of the object or modification of

Create a Class and the Class has the following:

Name

  • a String of maximum 50 characters
  • if upon construction of the object or modification of the name data member, the name is being set to a String longer than 50 character you need to truncate the string at 46 characters and append the character sequence ... to the end (that is a leading space before the ...)

Date

  • A string of the format yyyy-mm-dd

The class should have the following methods

  • a constructor which takes values for all 4 attributes and sets them need to ensure that the name string length is not exceeded otherwise do as require
  • Need to ensure that incoming value for Date is in the required format If not, leave blank.

in C, C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!