+1443 776-2705 panelessays@gmail.com

Are you looking for Reliable Online Writing Services? We are Here For you. Our Professional Tutors Can Handle Any Kind of Assignment. Don’t Use Plagiarized Sources. Get Your Perfect Paper Today! Click Here To Order.

Below is the problem given, please provide a complete java program for the below problem and please provide very easy to understand code.ACCESS MODIFIERS IN OBJECTSPlease note that all object attributes must have private as their access modifier. Any classes that have any non-private object attributeswill result in the wrong program. This includes omitting access modifiers, which means that the object attributes have the java default access modifier package. Problem Background Note that adding more hours to the total number of hours for that Lunarnaut may move the Lunarnaut up into the next skill, this has to be checked. The time has come to establish a permanent base on Moon. If this is successful, then it will be To end a Mission, the Compartment must actually be on a Mission. expanded into a much larger base. As this is just the verybeginning of the development, it has been decided to restrict the problem to just 2 Compartments. Program Requirements A Compartment is an all-purpose building that allows humans to work on Moon. You have been asked to write an interactive program, in Java, to aid in monitoring and maintaining all aspects of Moon Base Operations The people who go to Moon are known asLunarnauts. This program is a prototype and there will be only 2 Compartment objects in the program. If the The Lunarnauts carry out Missions. Missions vary and have a number of hours assigned to them. prototype proves successful, this will be expanded in the next assignment. The default is one Mission = one hour. To aid in the rapid development of this program, 3 Java files Alternatively, you could write an overloaded constructor that just takes the first two values (name and lunarnautId) as parameters and assigns 0 to the number of hours. Either way, the skill must be set by the constructor, not the user. This is where you write a private helper method in the Lunarnaut class, similar to the setCatagozy method in lab 7 The Lunarnaut class also requires accessormethods as you deem appropriate. The Lunarnaut class also requires a method to increment the number of hours. Calling this method adds more hours to the total number of hours. This method should then check whether that moves the Lunarnaut to the next skill. Recall that the default is one hour for a new Mission and the user must be asked ifthere are more hours associated with thisMission. The user must be able to press the enter key If there are no extra hours associated with the Mission. Actually entering D will lose marks. (Hint: think about the way we extracted Integers from Strings In Assignment A or the length of an empty String) If there are extra hours, then these extra hours plus the default one hour are added to the total number of hours for the L You might find it useful to write a method in the Compartment class that returns a boolean to indicate if the Compartment already has a Lunamaut or not. The Lunarnaut and Compartment classes do NOT ask the user for any Input, either keyboard or file. There must not be any Input objects In these classes such as Scanner or BufferedReader but not limited to these 2. Another way ofsaying this is that these classes are not Interactive. The driver program, MoonBase. java starts by presenting the user with a menu, as follows: Moon Base Main Menu . , m Compument Note. MoonBase class must NOT . Display Compartments have Lunamaut object attribute(s) or ~ “‘1 L’Emfna” t° “Warm” Lunamaut object references. All . Add MiSSion . . . . . Interactions Involvmg a Lunamautwull . End Mission Load from file be through the relevant Module . Exit the program obiect simUIbuNi-I Enter choice >> Implement the functionality of each menu choice as follows (assume user input is always an integer): L_Add_Compartment This menu option is chosen when the user attempts to add a Compartment object from the keyboard. If both of the Compartment o Compartment object reference, then the user is prompted (asked) for the Compartment id of a Compartment. The program must then find the Compartment that contains the Compartment object with this Compartment id. This could be the first Compartment object or the second Compartment object (if it exists). If the Compartment id is not found, then an appropriate message is displayedto the screen and the program retums to the main menu. If the Compartment id is found. then the program must check that this Compartment is available for a Mission. To be available for a Mission. the Compartment must not on a Mission (working) and the Compartment must have a Lunarnaut. That is, the Lunarnaut object reference in the Compartment object in which the Compartmentwith the user entered Compartment id was found, must have a Lunarnaut object attached to it, If the Compartment is not available for a Mission, then an appropriate message is displayed to the screen and the program returns to the main menu. After passing the checks above, the user is asked to enter the required skill of the Mission. If the Lunarnaut has the required skill, then Lunarnaut object to read and the next 3 lines are required to instantiate the Lunarnaut object reference in the same Compartment object, if there is a Lunarnaut object. The file may contain any number of records. As a final note, consider that when the user enters a Lunarnaut id or a Compartment id from the keyboard, to add a Lunarnaut or add a Compartment, the program must check thatthe Lunarnaut id or Compartment id are not already in use. If they are, then the user is informed with an appropriate message to the screen and the method returns to the main menu. Lunarnaut id’s and Compartment id’s in the input file are guaranteed to be unique and you may assume that the user will not enter a Lunarnaut id or a Compartment id from the keyboard that is already in the inputtext file, even though you have not read the text file. Your program does NOT need to check for this. The user can select this add from input file option at any time whilst the program is running, it does not have to be at the start. 7. Exit the program This menu choice closes the program. Example run of the program (NOTE not all functionality and error checks/messages are shown) user input in bold java MoonBase Moon Base Main Menu 1. Add Compartment 2. Display Compartments 3. Add Lunarnaut to Compartment 4. Add Mission 5. End Mission 6. Load from file 7. Exit the program Enter choice > > 2 No Compartments added yet, nothing to display Moon Base Main Menu 1. AddCompartment 2. Display Compartments 3. Add Lunarnaut to Compartment 4. Add Mission 5. End Mission 6. Load from file 7 . Exit the program Enter choice >> 3 No Compartments present, cannot add Lunarnaut until at least one Compartment has been constructed Moon Base Main Menu 1. Add Compartment 2. Display Compartments 3. Add Lunarnaut to Compartment 4. Add Mission 5. End Mission 6.Load from file 7. Exit the program Enter choice > > 4 No Compartments in the Base So no Lunarnauts yet Create at least one Compartment and assign at least one Lunarnaut before adding Missions ! Moon Base Main Menu 1. Add Compartment 2. Display Compartments 3. Add Lunarnaut to Compartment 4. Add Mission 5. End Mission 6. Load from file 7. Exit the program Enter choice > > 6. Load from file 7. Exit the program Enter choice >> 1 Enter Compartment id >> k 45 H Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 2 Imunbwmb—t Here is the information for the Compartments Compartment[ id: k 45 H Currently is noton a Mission No Lunarnaut assigned to this Compartment Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 3 Enter Compartment id >> E 56 Imunbwmb—t No Compartment with that id was found Moon Base Main Menu Add CompartmentDisplay Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 1 Enter Compartment id >> k 45 h Imunbwmb—t Compartment id’s must be unique That Compartment id is already in use Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Moon Ease Main Menu Compartmentl id: 0 C 27 . Add Compartment Currently is on a Mission . Display Compartments Lunarnaut [ name : Third Person . Add Lunarnaut to Compartment id : B 03 hours : 12 Add Mission skill : Life Aid End Mission ] . Load from file ] . Exit the program Enter choice >> 3 Moon Base Main Menu Enter Compartment id >> I: 45 h 1. Add Compartment EnterLunarnaut id >> D 001 2. Display Compartments Enter Lunarnaut name >> Icon 01 Person 3. Add Lunarnaut to Compartment 4 5 lmUlhthfi—l . Add Mission . End Mission Moon Ease Main Menu 6 Load from file 7. Exit the program Enter choice >> 5 Enter Compartment id >> I: 45 h That Compartment is not on a Mission so cannot end a Mission Moon Ease Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 5 Enter Compartment id >> 0 c 27omuueonou Moon Ease Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 2 IO’UI-DWNH Here is the information for the Compartments Compartment[ id: k 45 H Currently is not on a Mission Lunarnaut [ name 2 Moon 01 Person id 2 D 001 hours 2 0 cap : Ease onlyCompartment[ id: 0 c 27 Currently is not on a Mission Lunarnaut [ name : Third Person id E 03 hours : 12 Life Aid Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 1 snoiumewmn The base is full, no free Compartment spaces Moon Ease Main Me Enter Mission level >> ranches Enter extra hours default is a, just press the enter key for a, or enter extra hours >> 16 Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 2 qmwwaH Here is the information for the Compartments Compartmentt id: k 45H Currently is on a Mission Lunarnaut [ name : Moon 01 Person id : D 001 hours : 1 cap : Ease only Compartment[ id: 0 C 27 Currently is on a Mission Lunarnaut [ name : Third Person id : B 03 hours : 29 cap : Moon rover 1 Moon Base Main Menu . Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enterchoice >> I Enter Compartment id >> k 45 h ImwwaH This Compartment is already on a Mission, cannot add another Mission till current Mission is completed Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 5 Enter Compartment id & r Add Lunarnaut to Compartment . Add Mission End Mission Load from file Exit the program Enter Choice >> 3 Enter Compartment id >> I: 45 H Enter Lunarnaut id >> K 002 Enter Lunarnaut name >> Moon 03 Person Jmmbm Moon Base Main Menu . Add Compartment Display Compartments , Add Lunarnaut to Compartment . Add Mission End Mission Load fromfile Exit the program Enter choice >> 3 Enter Compartment id >> K 15 h sumo-slowe- This Compartment already has a Lunarnaut Moon Base Main Menu . Add Compartment Display Compartments . Add Lunarnaut to Compartment r Add Mission End Mission Load from file Exit the program Enter choice >> 1 Enter Compartment id >> CV 64 ammeunou Moon BaseMain Menu r Add Compartment Display Compartments . Add Lunarnaut to Compartment . Add Mission End Mission Load from file Exit the program Enter Choice >> 2 ImmmeH Here is the information for the Compartments compartmenu id: K 45 1-] Currently is not on a Mission Lunarnaut [ name : Moon 03 Person id K 002 hours : 0 cap Base only 1 Compartment[ id: Currently is on a Mission Lunarnaut [ name : Moon 03 Person id : K 002 hours : 11 cap : Life Aid Compartment[ id: CV 64 Currently is not on a Mission No Lunarnaut assigned to this Compartment Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 5 Enter Compartment id >> CV 64 c c ¢ ¢¢ mJONU’IbLDNl-I C c That Compartment is not on a Mission so cannot end a Mission Moon Base Main Menu Add Compartment Display Compartments Add Lunarnaut to Compartment Add Mission End Mission Load from file Exit the program Enter choice >> 7 c c c c c mJChU’IbLUNi-I C a Good bye from Moon Base Currently Open Documents ~/Downloads/Lunarnaut.java – (no function selected) . # – Lunarnaut.java X 1 /* MoonBase.java * Class Name: Lunarnaut 4 Author: Your Name 5 6 * Creation Date: Monday, September 07 2020, 15:52 7 Last Modified: Monday, September 07 2020, 15:53 8 Class Description: 9 10 * Lunarnaut class is for the people who work in the Compartments. 11 * This is forAssignment B, Semester 2, 2020 CSE10OF 12 * 13 14 15 public class Lunarnaut 16 17 18 19 20 L: 1 C: 1 Java . Unicode (UTF-8) . Unix (LF) – Saved: 12/9/20, 3:39:59 pm 352 / 47 / 20 100% – Currently Open Documents ~/Downloads/Compartment.java . (no function selected) . # . Compartment.java x 1 V Lunarnaut.java X 2 * Class Name: Compartment MoonBase.java 3 * 4 * Author: Your Name 5 k Creation Date: Monday, September 07 2020, 15:50 6 * Last Modified: Monday, September 07 2020, 15:51 7 8 * Class Description: 9 10 * This is the Compartment class for CSE10OFAssignment B, 11 13 * Semester 2, 2020 12 * 14 15 public class Compartment 16 V 17 18 L 19 ~/Downloads/MoonBase.java . VOUIDWNH * Class Name: MoonBase * * Author: Your Name * Creation Date: Monday, September 07 2020, 15:50 * Last Modified: Monday, September 07 2020, 15:55 * 8 9 * Class Description: * 10 * This is the main driver file for CSE10OF Assignment B 11 12 * Semester 2, 2020 13 14 * 15 16 import java. util. Scanner; 17 import java. io. IOException; 18 import java. io. File; 19 20 21public class MoonBase 22 private Compartment c1; 23 24 private Compartment c2; 25 private Scanner kb; 26 private final int ADD_COMPARTMENT = 1; 27 private final int DISPLAY = 2; 28 29 private final int ADD_LUNARNAUT = 3; 30 private final int ADD_MISSION = 4; 31 private final int END_MISSION = 5; 32 private final int LOAD_FROM_FILE = 6; 33 private final int EXIT = 7; 34 public static void main(String [ ] args ) throws IOException 35 36 MoonBase mb = new MoonBase ( ); 37 mb . run ( ) ; 38 39 40 public MoonBase( ) 41 42 43 > ” ); 55 choice = kb. next 107 System. out. printIn(“nThat is not a valid choice” ); 108 break; 109 110 111 112 public void addCompartment( ) 113 114 115 116 117 public void display( ) 118 119 120 121 122 public void addLunarnaut( ) 123 124 125 126 127 public void addMission( ) 128 129 130 131 132 public void endMission( ) 133 134 135 136 137 public void load( ) throws IOException 138 139 140 141 – 142 143 L: 1 C: 1Java – Unicode (UTF-8) . Unix (LF) . Saved: 12/9/20, 3:40:04 pm 3,189 / 257 / 143 100% Engineering & Technology Computer Science BIM BUS5