An auto dealership has 50 cars and 50 customers who all show up simultaneously when the dealership opens.. All cars are off when the dealership doors open. As the customers enter, the first customer, denoted C1, starts every car. Then the second customer, C2, beginning with the second car, denoted Car 2, turns off every second car (Car 2, Car 4, Car 6, etc). Customer C3 begins with the third car Car 3 and changes every third car (starts it if it was stopped, and stops it if it was started). Customer C4 begins with Car 4 and changes every fourth car. Customer C5 starts with Car 5 and changes every fifth car, and so on, until customer C50 changes Car 50.

Reverend Jim commented: Lazy -3

Recommended Answers

All 5 Replies

Congratulations. You have passed the 'I can cut and paste my homework question' test. Shame you will probably fail your class though, if you think others will do your work for you.

Especially as I note this was your second cut and paste in a matter of minutes - I've deleted the other one and infracted you under our rules. See them here: "provide evidence of having done some work yourself if posting questions from school or work assignments."

Here at DaniWeb we expect you to show us your code, explain when you are stuck and then maybe someone will be able to help you.

We are not here to do your homework for you though...

commented: Hear ye! Hear ye! +14

And too lazy to even ask a question.

I had a professor who used to give out assignments like this. He would not provide the question that you were supposed to answer. Part of the assignment was that you had to think of what question could go along with the assignment. I'm figuring it's either "How many times were keys turned?" or "Which cars are on and which cars are off?" I always liked these assignments, but there was a guy in class, a smart guy and a good student, who absolutely hated problems like this. He was a real down to Earth guy and would get sidetracked by the idea that this would never ever happen in a car dealership. He also had a problem in Economics classes. He could figure out how many cars or tricycles or loaves of bread to sell and how much profit he'd make, but he just couldn't sell "widgets" to save his life. He just couldn't think abstractly, or more accurately, didn't understand why anyone would want to think up or solve problems like this.

Part of the assignment was that you had to think of what question could go along with the assignment.

Maybe the real assignment was to approach the professor to nail down the actual requirements. You know, like you should do if you are asked to do something in real life? If you don't know what your program is supposed to do then you shouldn't start writing it.

Maybe the real assignment was to approach the professor to nail down the actual requirements. You know, like you should do if you are asked to do something in real life?

Had a professor like that too. He would intentionally go into "dumb impatient client" mode. He would intentionally pretend he didn't know anything about Project Management and computers. For the Senior Project, he would "hire" your team to do whatever. He had a strong belief that often clients/bosses don't actually know what they want and the main part of your job was to figure out what they really wanted, help them understand what they wanted, etc. So he'd "hire" you to create an inventory system, then you'd have to track him down to get the details, he'd ask for impossible or outrageously expensive things and you'd do them and present a bill that was way more than he expected, so he wouldn't "pay" you. He'd go in and out of his modes. You never knew when you were talking to the professor or the impatient client. Sometimes you would pensively ask the professor about how to handle this extremely annoying client and he'd talk about how he had talked to the client and that the client was annoyed at us as well and how the client wanted him to fire us (now in "boss of the company" mode). He had to have had multiple personalities in real life. He did all this without preambling "Now I'm in professor mode". He'd just switch and not tell you he was switching. It was extremely aggravating, but if you had the right attitude, you could learn a lot.

commented: And I had a few professors who barely had even one personality. +14
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.