1. Homepage
  2. Programming
  3. [2022] Cardiff - CMT202 Distributed and Cloud Computing - Coursework - Distributed data storage system

[2022] Cardiff - CMT202 Distributed and Cloud Computing - Coursework - Distributed data storage system

Engage in a Conversation
CMT202Distributed and Cloud ComputingCardiff

Assignment CourseNana.COM


CourseNana.COM

CourseNana.COM

You have been hired by a car rental company to build a distributed data storage system using a remote object paradigm that will allow one to store and access information relating to rental cars, manufacturers of cars and users who rent cars. CourseNana.COM

  CourseNana.COM

Each manufacturer has the following two associated pieces of information which should be stored in the system: CourseNana.COM

1. Manufacturer name. CourseNana.COM

2. Manufacturer country which refers to the country in which the manufacturer is based (e.g. BMW is based in Germany). CourseNana.COM

  CourseNana.COM

Each rental car has the following two associated pieces of information which should be stored in the system: CourseNana.COM

1. Car manufacturer name. CourseNana.COM

2. Car model. CourseNana.COM

  CourseNana.COM

Note, multiple cars with the same manufacturer and model can exist in the system. You can assume that no two manufacturers will have a car model with the same name. CourseNana.COM

  CourseNana.COM

Each user has the following two associated pieces of information which should be stored in the system: CourseNana.COM

1. User name. CourseNana.COM

2. User contact phone number. CourseNana.COM

  CourseNana.COM

Design and implement the above distributed data storage system using a remote object paradigm which allows employees of the car rental company to perform the following twelve tasks: CourseNana.COM

  CourseNana.COM

Task 1 CourseNana.COM

Add a user to the system. Implement this using a method with the following header: CourseNana.COM

def add_user(self, user_name, user_number) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.add_user(“Allen Hatcher”, 123456) CourseNana.COM

  CourseNana.COM

You can assume that each user added to the system has a unique user name. CourseNana.COM

  CourseNana.COM

Task 2 CourseNana.COM

Return all associated pieces of information relating to the set of users currently stored in the system (i.e. a set of user names and contact numbers). Implement this using a method with the following header: CourseNana.COM

def return_users(self) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.return_users() CourseNana.COM

  CourseNana.COM

The information returned by this method should have the property that it can be easily interpreted when displayed using the Python print function. That is, the output from the following print function should be easily interpreted: CourseNana.COM

print(rental_object.return_users()) CourseNana.COM

  CourseNana.COM

Task 3 CourseNana.COM

Add a car manufacturer to the system. Implement this using a method with the following header: CourseNana.COM

def add_manufacturer(self, manufacturer_name, manufacturer_country) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.add_manufacturer(“BMW”, “Germany”) CourseNana.COM

  CourseNana.COM

Task 4 CourseNana.COM

Return all associated pieces of information relating to the set of manufacturers currently stored in the system (i.e. a set of manufacturer names and countries). Implement this using a method with the following header: CourseNana.COM

def return_manufacturers(self) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.return_manufacturers() CourseNana.COM

  CourseNana.COM

The information returned by this method should have the property that it can be easily interpreted when displayed using the Python print function. CourseNana.COM

  CourseNana.COM

Task 5 CourseNana.COM

Add a rental car to the system. Implement this using a method with the following header: CourseNana.COM

def add_rental_car(self, manufacturer_name, car_model) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.add_rental_car(“BMW”, “3 Series”) CourseNana.COM

  CourseNana.COM

When a rental is first added to the system it is initially not rented by any user. Multiple cars with the same manufacturer and model may be added to the system. You can assume that no two manufacturers will have a car model with the same name. CourseNana.COM

  CourseNana.COM

Task 6 CourseNana.COM

Return all associated pieces of information relating to the set of rental cars currently not rented (i.e. a set of car manufacturers and models). Implement this using a method with the following header: CourseNana.COM

def return_cars_not_rented(self) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.return_cars_not_rented() CourseNana.COM

  CourseNana.COM

The information returned by this method should have the property that it can be easily interpreted when displayed using the Python print function. CourseNana.COM

  CourseNana.COM

Task 7 CourseNana.COM

Rent a car of a specified model to a specified user on a specified date. Implement this using a method with the following header: CourseNana.COM

def rent_car(self, user_name, car_model, year, month, day) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.rent_car(“Conor Reilly”, “3 Series”, 2019, 1, 3) CourseNana.COM

  CourseNana.COM

Each rental car can only be rented to a single user at a time. For example, consider the case where there are two rental cars in the system with model equal to “3 Series” and both are currently rented. In this case another car with model equal to “3 Series” cannot be rented until one of the two above cars is returned or an additional car with model equal to “3 Series” is added to the system. CourseNana.COM

  CourseNana.COM

The method rent_car should return a value of 1 if the car in question was successfully rented. Otherwise, the method should return a value of 0. CourseNana.COM

  CourseNana.COM

Task 8 CourseNana.COM

Return all associated pieces of information relating to the set of cars currently rented (i.e. a set of car manufacturers and models). Implement this using a method with the following header: CourseNana.COM

def return_cars_rented(self) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.return_cars_rented() CourseNana.COM

  CourseNana.COM

The information returned by this method should have the property that it can be easily interpreted when displayed using the Python print function. CourseNana.COM

  CourseNana.COM

Task 9 CourseNana.COM

Return a rented car of a specified model by a specified user on a specified date; that is, change the status of the car in question from rented to not rented. Implement this using a method with the following header: CourseNana.COM

def end_rental(self, user_name, car_model, year, month, day) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.end_rental(“Conor Reilly”, “3 Series”, 2019, 2, 4) CourseNana.COM

  CourseNana.COM

You can assume that each user will only rent a single car of each model at any given time. Therefore, when a user returns a car of a specified model there is no confusion with respect to which car they are returning. CourseNana.COM

  CourseNana.COM

Delete from the system all rental cars of a specified model which are currently not rented. Rental cars which are currently rented should not be deleted. Implement this using a method with the following header: CourseNana.COM

def delete_car(self, car_model) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.delete_car(“3 Series”) CourseNana.COM

  CourseNana.COM

Task 11 CourseNana.COM

Delete from the system a specified user. A user should only be deleted if they currently do not rent and have never rented a car. Implement this using a method with the following header: CourseNana.COM

def delete_user(self, user_name) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.delete_user(“Conor Reilly”) CourseNana.COM

  CourseNana.COM

The method delete_user should return a value of 1 if the user in question was successfully deleted. Otherwise, the method should return a value of 0. CourseNana.COM

  CourseNana.COM

Task 12 CourseNana.COM

Return all car models a user previously rented where the corresponding rental and return dates both lie between a specified start and end date inclusive. CourseNana.COM

Implement this using a method with the following header: CourseNana.COM

def user_rental_date(self, user_name, start_year, start_month, start_day, end_year, end_month, end_day) CourseNana.COM

  CourseNana.COM

An example of calling this method is: CourseNana.COM

rental_object.user_rental_date(“Conor Reilly”, 2010, 1, 1, 2029, 2, 1) CourseNana.COM

  CourseNana.COM

Note, the car models returned may contain duplicates if the user rented the model in question more than once. CourseNana.COM

  CourseNana.COM

The information returned by this method should have the property that it can be easily interpreted when displayed using the Python print function. CourseNana.COM

  CourseNana.COM

In your solution to the above assignment, the class in question should be called rental. That is, when defining the class use the expression “class rental(object):”. Also, the class must be contained in a file entitled rental.py. CourseNana.COM

  CourseNana.COM

In the file rental.py you should create an object of type rental and register this object with the name server using the name example.rental. That is, the file rental.py should contain the following code snippet: CourseNana.COM

daemon = Daemon() CourseNana.COM

serve({rental: "example.rental"}, daemon=daemon, use_ns=True) CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
CMT202代写,Distributed and Cloud Computing代写,Cardiff代写,CMT202代编,Distributed and Cloud Computing代编,Cardiff代编,CMT202代考,Distributed and Cloud Computing代考,Cardiff代考,CMT202help,Distributed and Cloud Computinghelp,Cardiffhelp,CMT202作业代写,Distributed and Cloud Computing作业代写,Cardiff作业代写,CMT202编程代写,Distributed and Cloud Computing编程代写,Cardiff编程代写,CMT202programming help,Distributed and Cloud Computingprogramming help,Cardiffprogramming help,CMT202assignment help,Distributed and Cloud Computingassignment help,Cardiffassignment help,CMT202solution,Distributed and Cloud Computingsolution,Cardiffsolution,