Question: This is a java program problem within eclipse that Involves using stacks and computing the income of a small parking lot. I have provided the
This is a java program problem within eclipse that Involves using stacks and computing the income of a small parking lot. I have provided the needed classes and Lot.txt file at the bottom of this problem.




Lot.txt:
A EARLYBIRD 06 30 A WORKER 07 00 A CEO 07 15 A CLERK 07 30 A MANAGER 08 00 A VP 09 00 D CLERK 09 30 A SHOPPER 10 15 D CEO 10 00 D EARLYBIRD 10 30 D WORKER 11 00 A JANITOR 11 00 D MANAGER 11 30 A STUDENT 11 35 A HOUSEWIFE 12 45 A RETIREE 13 30 A SALESMAN 13 45 D STUDENT 15 30 A CONTRACTOR 16 00 D SHOPPER 16 30 D JANITOR 19 30 D HOUSEWIFE 20 00 D RETIREE 21 15 D CONTRACTOR 23 00
Stack.Java:
package chapter19; public interface Stack{ public void push (T element); // POST: add element to top of stack public T pop ( ); // PRE: stack is not empty // POST: remove top element and return public T peek ( ); // PRE: stack is not empty // POST: return top element public boolean isEmpty( ); // POST: return true if stack is empty, else false public int size ( ); // POST: return number of elements in stack }
Part II: (80 pts) This program will compute income from a small parking lot. It uses a stack to hold cars in LIFO order. Use one of the stack classes developed in lecture or the Java Stack class. A company rents a 5-car alley for parking. The alley is so narrow that the only egress is at the top, forcing vehicles to be removed one at a time in order to retrieve an internal one. Vehicles are temporarily parked on the street in metered slots until they can be returned to the alley. Research the LocalTime class and use its methods to store and manipulate time. alley is a stack street metered parking One day' s data set is available in arrival ("A") or departure ("D") Arrival/Departure Code License (ex. "BOSS") Arrival Departure time nteger hour blank minute (ex. 10 30 or 21 45)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
