How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Scott Your Own Question

Scott
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
3546829
Type Your Homework Question Here...
Scott is online now
A new question is answered every 9 seconds

Programming assignment in Python

Customer Question

Attachment: 2015-03-20_145516_programming-assignment-elevator.doc

Hi Ingo, I have a problem with my programming assignment in python. I have the program ready but I think there is something missing along the lines. I would need assistance in checking the code and fixing it to comply with the spec. It is a simple elevator program. Spec below:





Elevator Simulator

This assignment will give you more experience on the use of:
1 classes
2 class methods

3 object-oriented programming
The goal of this project is to gain more practice with classes and Object-Oriented Programming. In this project, we are going to simulate a simple elevator.
Task
Your task is to implement the simple elevator in Python using classes. The default strategy is the simple "start at the bottom, go to the top, then go to the bottom". You don't have to use this, you can take an alternative approach such as random start location for the elevator.
Project Description / Specification
1 Create three classes: Building, Elevator, and

Customer.
2 Equip the building with an elevator. Ask user to

customize the number of floors and the

number of customers.
3 Program should have error checking to make sure

the user inputs are valid. For example, if a user gives non-integer inputs, notify the user that the inputs are incorrect and prompt again.

4 Each customer starts from a random floor, and has a random destination floor.

5 Each customer will use the elevator only once, i.e., when a customer moves out of the elevator, he/she will never use it again.








6 When all customers have reached their destination floor, the simulation is finished.

7 Part of the grade on this assignment will be the appropriateness of your classes, methods, and any functions you use. The quality of the code will now matter as well as the performance.

8 All classes’ methods require a docstring for a general description of the method.

9 Don’t use any global variables.
Notes and Hints
In your main function, at the beginning ask the user for the number of floors and the number of customers which can be used to create an instance of Building. Then we only need to call a run method and an output (such as __str__ or __repr__) method repeatedly in a while loop. Randomly select the floors (to and from) for each customer. Use the randint function from the random module. To estimate the efficiency of strategy, count the number of floors visited for your strategy. Make a demo to create usable output from your simulation.




Submitted: 1 year ago.
Category: Homework
Expert:  Ingo U replied 1 year ago.
Hi,
thanks for requesting me! I'd love to help you but frankly the amount offered is a bit low for the work requested. How would you feel about €50 ?
Customer: replied 1 year ago.

No thanks, ***** ***** I will ask my class mates, and I'm sure someone will give me a hand, thanks nether less

Expert:  Ingo U replied 1 year ago.
Fair enough, good luck with everything. Maybe some other time...

Related Homework Questions