Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello! I am having a problem with my code. I keep getting this error and I am not sure why. Here is my instructions, my

Hello! I am having a problem with my code. I keep getting this error and I am not sure why. Here is my instructions, my code and the error message. The code is done in Java. May you please help me solve this issues?

image text in transcribedimage text in transcribedimage text in transcribed

sules for parking: As the occupancy instance variable is populated, you need to ensure that the following rules are always respected: - No car can be parked at a spot that is designated NA in the lot design; - A car cannot be parked at an out-of-bound position; - At most one car can be parked at any given (non-NA) spot; - An electric car is allowed to park at any (non-NA) spot: ELECTRIC, SMALL, REGULAR, LARGE; - A small car is allowed to park only at the following spot types: SMALL, REGULAR, LARGE; - A regular car is allowed to park only at the following spot types: REGULAR, LARGE; - A large car is allowed to park only at the following spot type: LARGE; If a car in the input file violates any of the above rules, it will not be parked at the specified spot. For example, consider the input file in Figure 5. For this input file, only one of the cars specified, namely the car with plate C3, can be parked. C1 is a large car attempting to park at a small spot (0,1). C2 is attempting to park at an NA spot (2,2). C4 is attempting to park at a spot already occupied by C3. Finally, C5 is attempting to park at a spot with indices that are out of bound. ParkingLot.java:135: error: bad operand types for binary operator ' return ( ( spot == CarType.ELECTRIC) || (spot == CarType.SMALL) (spot == CarType.REGULAR) ||( spot = CarType.LARGE )); first type: boolean second type: CarType

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

Students also viewed these Databases questions

Question

Define and give examples of a de minimis employee fringe benefit.

Answered: 1 week ago

Question

Explain the term robust design. Give an example.

Answered: 1 week ago

Question

Prepare for a successful job interview.

Answered: 1 week ago

Question

Describe barriers to effective listening.

Answered: 1 week ago

Question

List the guidelines for effective listening.

Answered: 1 week ago