Question: a. Create a class named Trip that includes four string variables: destination (for example, London), means of transportation (for example, air), departure date (for example,

a. Create a class named Trip that includes four string variables: destination (for example, London), means of transportation (for example, air), departure date (for example, 12/15/2015), and trip's purpose (for example, business). Include two overloaded constructors. The default constructor sets each field to XXX. The nondefault constructor accepts four parametersone for each field. Include two overloadeddisplay() methods. The parameterless version displays all the Trip details. The second version accepts a string that represents a destination and displays the Trip details only if the Trip's destination matches the parameter.

b. Create an application that instantiates several Trip objects and demonstrates all the methods.

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!