Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Question Write a method called loadOutlets that will read the details of a fast food company's outlets from a text file, store these details
Java Question
Write a method called loadOutlets that will read the details of a fast food company's outlets from a text file, store these details in objects of the class Outlet and store each object of class Outlet in an ArrayList called outlets. You may assume that outlets has been declared elsewhere in the class containing the method loadOutlets and is visible inside loadOutlets and that all required Java packages have been imported. The class Outlet has a non-default constructor and takes all three of its attributes as parameters, they are: location, a String describing where the outlet is located. * phoneNumber, a String representing the phone number of he outlet . suburb, a String representing the suburb, other than the suburb it is located, to which the outlet makes deliveries The method loadOutlets takes the name of the text file as a parameter of type String and returns a boolean value to indicate whether the read operation has been a success The text file will store the outlets' data in the form (ie. 3 lines of data per outlet): Caulfield 98762345 Malverrn You must ensure the data read from the file does not exceed MAXIMUM NUMBER OF OUTLErS, which is a static constant declared in your program and visible inside loadoutletsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started