Design a class named Space Mission that contains:
Part A:
- A private int data field named spaceMissionId for the mission.
- A private int data field named numberOfAstronauts (default 1).
- A private Date data field named missionAssignmentDate that stores the date when the mission was assigned.
- A private Date data field named missionBegDate that stores the date when the mission will start.
- A private Date data field named missionEndDate that stores the date when the mission will end.
- A private double data field named missionBudget (default 1,000,000.00).
- A private double data field named missionFinalCost (default 1,000,000.00).
- A private string data field named missionOrigin (default “Earth”).
- A private string data field named missionDestination(default “Mars”).
- A private string data field named missionStatus (options “Scheduled”, “Launched” or “Cancelled”, default “Scheduled”)
- three-argument*constructor that creates a mission with a specific missionBegDate, missionEndDate, and numberOfAstronauts and initializes the spaceMissionId with a 5-digit random integer and the missionAssignmentDate with the date when the mission was created.
- five-argument* constructor that creates a mission reservation with a specific missionBegDate, missionEndDate, missionOrigin, missionDestination and numberOfAstronauts and initializes the spaceMissionId with a 5-digit random integer and the missionAssignmentDate with the date when the mission was created.
- The accessor and mutator* methods for numberOfAstronauts, missionBegDate, missionEndDate, missionBudget, missionOrigin, missionStatus and missionDestination.
- The accessor (no mutator) methods for spaceMissionId and missionAssignmentDate.
- A method named cancelMission() that cancels the mission.
- A method named launchMission() that launches the mission.
- A method named getCostPerTraveler() that returns the total cost per traveler.
- A method named missionCostOverrun() that calculates difference between mission budget and final cost.
*Provide appropriate input validation for these methods. Print a message to the console if the arguments passed to the method do not pass the validation test(s).
Part B:
- Using the SpaceMission class as a base class, write two derived classes called PrivateMission and GovernmentMission.
- A PrivateMission object, in addition to the attributes of a SpaceMission object, should have fields numberOfAvailableSeats (default 4), spaceCompanyName (string defaulted to “SpaceX”) and flightNumber (string defaulted to “PM*”). Provide accessors and mutators for all fields.
- A GovernmentMission object, in addition to the attributes of a SpaceMission object, should have fields numberOfAvailableSeats (default 6), internationalMission(default False), countryLaunchName (string defaulted to “United States”) and flightNumber (string defaulted to “GM*”). Provide accessors and mutators for all fields.