Create a class based on the design shown below. The default constructor would assign specific details determined by the programmer for time and carNumber. The overloaded constructor would assign values for time and carNumber when the object is created. The setModel and setCapacity functions assign values for model of entered car and capacity of car park. The readCarNumber() is a function to remove embedded blanks in a given string
as a car number. For example, if the carNumber is entered WQ R 2467, the readCarNumber() function will return WQR2467 . The toString() function is invoked to display values of all the data. Be wary about using a double variable with string. Complete the program by creating objects of Car Park using both the default constructor and overloaded constructor in the main function. Use the objects to invoke the related functions.
Comments
Leave a comment