Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Introduction Figure I: Example input file you will party the input dass and build the concept as lotDesign!. These arrays will be populated with

java

image text in transcribed
Introduction Figure I: Example input file you will party the input dass and build the concept as lotDesign!. These arrays will be populated with the data in the input file. The lotbeston variable represents Car Type is an enumeration class defined as fullerwas ONE "ELECTRIC, SPALL, REGULAR, LARGE, NA: In the input file, the letter "E" means FI.BCTRIC. "S lose is used in the parking lot design when a spot is usunable ce parking a car (e-g. when pillars of building facilities are blocking the spot) ng spots par row R R L L E s parking spots per row " me nva nstarce provided in the template code in the form of comments. The locations where you need to write code borve been searly indicated with an infine comment that reads as follows ( WRITE YOUR CODE HERE: knee tostrength The thots for both car and Parkagot a encouraged to study them chictully Car and Parkingd at haw methods in Car and Parking ot have been implemented, running parkinglot saint will produce the followingpure . More than me formate skin our example, there is a total of thece cars parked in five Bag; Shoe tu Total" center or methane shoes to process; parking. int Total of cars carrently parked in the let : 3 B B. L. L. Important Considerations (Please Read Carefully!) below are some important considerations that you need to account for in your implement Structure of the input file The structure of the input file is as depicted in Figure s This part specites the lot design. The in the lot design are separated by the Tree There arecringey information Each row reposants row index, spotwithinnow index, car type, plate auriber using theo instance variables that are respectively declared moti the lot design and occupam private cartiff WhatDesign; dimensions of the por have delimiter in the input me. Later on in the course, the why are expandthe dow structure like linked Thus which do not have a fixed size , allowing elements to be added to them as you go along. For thin assignment ebpeste you are both den from wring list or similar data structures with non-fixed signs, Instead. you are a two pass strategy. The means that you well so ter (the lot- design part of the input file twice, In the first rectangular shape with all rows having the same number of spees in them. with the dime mile, you can populme (the sow imeantinted) lot Design and occupancy. Note that, an illustrated in Figure 2. spate pro now x row array. While this latter strategy is correct, you are asked to use the fannies (that is. wing blank spaces and empty liness Blank spaces and empty lines should be discarded. For example, con lines added. These spaces and new lines need to be trimmed and ignored. simply put, spaces and empey Time 5. 5. 5. 5. N 1. 2. L. MED 3. 3. S. MEx Figure 4: Example with are always respected . No car can be parked at a spot that is designated NA in the lot design: . At most one car can be marked at any alumninon - NAL spot . An electric car is allowed to park at any (con- NA| spot: ELECTRIC, SMALL, REGULAR, LARGE; . A regular car is allowed to pick only at the following ark only at the following sport types REGULARMAR. LARGE . A large car is allowed to park only at the following spot type: LARGE: consider the input file in Figure S. For this inprod file, only one of the cars specified, namely the car with plate NA spot (2. 21. CA is attempting to park at a spot already occupied by Ca. Finally, CS is attempting to park at Figure S Example Input The suit put resultin Puchtermin bep 'ite je process: parking-with-errors, int car tical cannot be ported at 12:3) far sical cinmet be marked at 13b Murder of cats currently parked in the Yet . I To. Parking Occupancy save Implementation you in the template code ( see the "Piles" section. discussed later). You cannot change any of the signatures of the new public methods or vartables . You can , however . add new private methods to prove the re Car tructer in the Car clan. ParkingLot There Provided in the template code in the term and comments The because where you need to write code have WRITE YOUR CODE HERE! The easiest way to navigate the template code is to start from the main method of the Parkinglot class, shown dentinfo. al splay( 1, which is a method that you will need to complete . Next. it reads from the standard input method prints to the mandand output information about the Parkinglot instance then wispdearly public static vold rain(String argo[ 1) throws Exception Student Info.display(); System.out. print ("Please enter the name of the file to process: "); Scammer scanner s new Scanner (System. in); String stef I lename = stammer, nextline(): ParkingLet lot - new ParkingLot (stef ilenase )3 lot . getTotalCapacity!)): orkable spots (capacity): " . System. out.print (lot); Figure to The rain method in DataSet Please note that there are a couple of technicalities which you will his assignment, the template code for aidenment. but you will see that some methods in the code are declared as theowing exceptions. You can ignore " pielie static CarType getCarTypeByLabel(String label): Returns the CarType literal associated with encastatic String getLabelByCarTyperC

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions