Please give me help

To write a program in Java: 20 parking places. When a car needs parking, the system automatically gives an available parking space,and update the number of cars available.

Hello, I believe you haven’t received a solution yet because we can’t identify the question (or the point at which you require help) from the statement given.
You should be clearer.:wink:

2 Likes

sounds like a job for… Arrays!

set up some basic array stuff and work with that?

var maxLen = 20;
var spaces =  Array(maxLen).fill(0); // init array to 20 items.
var park = spaces.splice(1, 1); // remove one available space from array

I need code written in Java.thank you very much.

When a car in the parking lot needs parking, the system automatically gives it a parking space and updates the available parking space
I need code written in Java.thank you very much.

https://rumadak.wordpress.com/2015/01/21/java-car-park-management-system/

2 Likes

thank you very much! This has helped me a lot.:smile:

Java is not one of the languages we teach here. You are welcome to ask questions about it, just realize that it is not our specialty. There are some people that do Java here, but it is not he focus. But it is bad form to ask us to do the program for you - we are not a bunch of people taking on other people’s coding work. We are people helping each other learn.

Better forum etiquette would be for you to post what you’ve done so far and ask us why it isn’t working. We are not here to help you do your homework or build something for you for free.

For anyone with any coding experience, this is a pretty trivial problem. I would suggest starting with a beginner Java book. And a simple google search will help you find a Java forum where you will get better responses.

3 Likes

Thanks for the tip. My idea wasn’t to have someone else do it for my code. I knew I had to practice it myself.But I need a teacher’s guidance as I study.You’re good Java users.You can be my teachers.

You still haven’t provided any evidence that you’ve even attempted the problem. The point of homework is that you try to complete it yourself first, and ask Mom and Dad for help only when you get stuck.

1 Like

So what have you tried so far? Xiija already gave a hint — did you try Googling arrays in java?

2 Likes