Design a class named Space Mission that contains:

Part A:

  1. A private int data field named spaceMissionId for the mission.
  2. A private int data field named numberOfAstronauts  (default 1).
  3. A private Date data field named missionAssignmentDate that stores the date when the mission was assigned.
  4. A private Date data field named missionBegDate that stores the date when the mission will start.
  5. A private Date data field named missionEndDate that stores the date when the mission will end.
  6. A private double data field named missionBudget (default 1,000,000.00).
  7. A private double data field named missionFinalCost (default 1,000,000.00).
  8. A private string data field named missionOrigin (default “Earth”).
  9. A private string data field named missionDestination(default “Mars”).
  10. A private string data field named missionStatus (options “Scheduled”, “Launched” or “Cancelled”, default “Scheduled”)
  11.  three-argument*constructor that creates a mission with a specific missionBegDatemissionEndDate, and numberOfAstronauts and initializes the spaceMissionId with a 5-digit random integer and the missionAssignmentDate with the date when the mission was created.
  12. five-argument* constructor that creates a mission reservation with a specific missionBegDatemissionEndDatemissionOrigin, missionDestination and numberOfAstronauts and initializes the spaceMissionId with a 5-digit random integer and the missionAssignmentDate with the date when the mission was created.
  13. The accessor and mutator* methods for numberOfAstronauts, missionBegDate, missionEndDate, missionBudget, missionOrigin, missionStatus and missionDestination.
  14. The accessor (no mutator) methods for spaceMissionId  and missionAssignmentDate.
  15. A method named cancelMission() that cancels the mission. 
  16. A method named launchMission() that launches the mission. 
  17. A method named getCostPerTraveler() that returns the total cost per traveler.
  18. 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:

  1. Using the SpaceMission class as a base class, write two derived classes called PrivateMission and GovernmentMission.
  2. 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.
  3. 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.