some new subject

PARKING LOT CODE NEED YOUR HELP GUYS!!!!!

The problem here is : In a parking lot of a shopping mall, the cars were being monitored inside and out. Every car that enters and leaves the parking area will be counted. Green lamp indicates that the parking lot is vacant and the red lamp is for full. The parking lot does not accept any car when it is full. Assume that the parking lot has a maximum of 10 cars only. Lamp will ON one at a time.

PLEASE GUYS I NEED YOUR RESPONSE..

PARKING LOT CODE NEED YOUR HELP GUYS!!!!!

The problem here is : In a parking lot of a shopping mall, the cars were being monitored inside and out. Every car that enters and leaves the parking area will be counted. Green lamp indicates that the parking lot is vacant and the red lamp is for full. The parking lot does not accept any car when it is full. Assume that the parking lot has a maximum of 10 cars only. Lamp will ON one at a time.

PLEASE GUYS I NEED YOUR RESPONSE..

Are you a new applier?

I guess the same course runs every 6 months. :slight_smile:

I don't understand why this is a complex problem - I suspect a failure to spend time thinking

You need a variable to hold the number of cars.

You need a function to keep track of the movements
When a car goes in the number is incremented
When a car leaves the number is decremented.

You need another function to manage the LEDs.
if the number in the variable is > X do one thing
if the number is less than X, do another thing.

...R

221bpeachy:
PARKING LOT CODE NEED YOUR HELP GUYS!!!!!

The problem here is : In a parking lot of a shopping mall, the cars were being monitored inside and out. Every car that enters and leaves the parking area will be counted. Green lamp indicates that the parking lot is vacant and the red lamp is for full. The parking lot does not accept any car when it is full. Assume that the parking lot has a maximum of 10 cars only. Lamp will ON one at a time.

PLEASE GUYS I NEED YOUR RESPONSE..

Hire a Parking Attendant with a Watch...

I'm spending all this time and (my parent's?) money on an education, why would I bother to learn what I'm being taught... I have the internet!

The sad thing is that eventually these folks get a degree and then show up for an interview. If you're not careful you end up hiring one. And as soon as you hand them a project that they can't go to the forum to get done for them they crash and burn and you are stuck with lost productivity and having to fire some poor sod who goes and repeats the process at the next employer.

Delta_G:
some poor sod who goes and repeats the process at the next employer.

Because the easiest way to get rid of him is to give him a good reference :slight_smile:

...R

I always enjoy helping these people. I don't have a degree myself, so any opportunity to cheapen the value of holding a degree is welcome. I dream of a world where a sheepskin is worthless in a job interview. "So what if you got a degree? You just got PaulMurrayCbr to do your homework for you! We'd rather hire him!"

Having said that, there's really not enough info here to write a response. Don't know where he's getting his I/O from.

int cars = 0;

void setup() {
  green_light_on();
  red_light_off();
}

void car_arrive() {
  if(++cars == 10) {
    green_light_off();
    red_light_on();
  }
}

void car_depart() {
  if(cars-- == 10) {
  green_light_on();
  red_light_off();
  }
}

Your lecturer (or more likely, TA) will respond "Wow! Mr gross77stonefruit has already mastered prefix and postfix increment operators! And it's only day 2!"