cloud computing assessment

CardiffSchool of Computer Science and Informatics

Coursework Assessment Pro-forma

Module Code: CMT202
Module Title: Distributed and Cloud Computing
Lecturer: Padraig Corcoran
Assessment Title: CMT 202 Coursework
Date Set: Monday 7 March 2022
Submission Date and Time: Monday 25 April 2022 at 9:30AM
Return Date: by Monday 23 May 2022

This assignment is worth 50% of the total marks available for this module. If
coursework is submitted late (and where there are no extenuating circumstances):

1 If the assessment is submitted no later than 24 hours after the deadline,
the mark for the assessment will be capped at the minimum pass mark;
2 If the assessment is submitted more than 24 hours after the deadline, a
mark of 0 will be given for the assessment.

Your submission must include the official Coursework Submission Cover sheet,
which can be found here:

https://docs.cs.cf.ac.uk/downloads/coursework/Coversheet

Submission Instructions

All submission should be via Learning Central unless agreed in advance with the
Director of Teaching.

Description Type Name

Cover sheet Compulsory One PDF ( ) file [student number]

Solutions Compulsory One zip (.zip) file containing the Python code developed. [student number].zip

The only additional software libraries which can be used are pyro5 and those in the
Python standard library. For example, you can use datetime but not pandas and
other database systems.

Any deviation from the submission instructions above (including the number and
types of files submitted) may result in a mark of zero for the assessment or question
part.

Staff reserve the right to invite students to a meeting to discuss coursework
submissions.

https://docs.cs.cf.ac.uk/downloads/coursework/Coversheet

Assignment

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.

Each manufacturer has the following two associated pieces of information which

should

be stored in the system:

1. Manufacturer

name.

2. Manufacturer country which refers to the country in which the manufacturer is

based (e.g. BMW is based in Germany).

Each rental car has the following two associated pieces of information which should

be stored in the system:

1. Car manufacturer name.

2. Car model.

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.

Each user has the following two associated pieces of information which should be

stored in the system:

1. User name.

2. User contact phone number.

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:

Task 1

Add a user to the system. Implement this using a method with the

following header:

def add_user(self, user_name, user_number)

An example of calling this method is:

rental_object.add_user(“Allen Hatcher”, 123456)

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

Task 2

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:

def return_users(self)

An example of calling this method is:

rental_object.return_users()

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:

print(rental_object.return_users())

Task 3

Add a car manufacturer to the system. Implement this using a method with the

following header:

def add_manufacturer(self, manufacturer_name, manufacturer_country)

An example of calling this method is:

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

Task 4

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:

def return_manufacturers(self)

An example of calling this method is:

rental_object.return_manufacturers()

The information returned by this method should have the property that it can be

easily interpreted when displayed using the Python print function.

Task 5

Add a rental car to the system. Implement this using a method with the following

header:

def add_rental_car(self, manufacturer_name, car_model)

An example of calling this method is:

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

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.

Task 6

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:

def return_cars_not_rented(self)

An example of calling this method is:

rental_object.return_cars_not_rented()

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

Task 7

Rent a car of a specified model to a specified user on a specified date. Implement

this

using a method with the following header:

def rent_car(self, user_name, car_model, year, month, day)

An example of calling this method is:

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

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.

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.

Task 8

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:

def return_cars_rented(self)

An example of calling this method is:

rental_object.return_cars_rented()

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

Task 9

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:

def end_rental(self, user_name, car_model, year, month, day)

An example of calling this method is:

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

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.

Task 10

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:

def delete_car(self, car_model)

An example of calling this method is:

rental_object.delete_car(“3 Series”)

Task 11

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:

def delete_user(self, user_name)

An example of calling this method is:

rental_object.delete_user(“Conor Reilly”)

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.

Task 12

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.

Implement this using a method with the following header:

def user_rental_date(self, user_name, start_year, start_month, start_day, end_year,

end_month, end_day)

An example of calling this method is:

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

Note, the car models returned may contain duplicates if the user rented the model in

question more than once.

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

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.

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:

daemon = Daemon()

serve({rental: “example.rental”}, daemon=daemon, use_ns=True)

I have provided a Python file entitled rental_test.py to help you test your code and

ensure all your methods have correct headers. To run this file, first run the name

server in one command prompt, the file rental.py in a second command prompt and

the file rental_test.py in a third command prompt.

Note that, to successfully complete all tasks, you are only required to store data

while your code is running; there is no requirement to write data to an external

database or file.

Learning Outcomes Assessed

The following learning outcomes from the module description are specifically being
assessed in this assignment.
Demonstrate and apply knowledge about the state-of-the-art in distributed-systems
architectures.
Appreciate the difference between various distributed computing middleware and
their communication mechanisms.

  • Criteria for assessment
  • Marks will be awarded based on successful system implementation as follows:
    Successfully implement task 1 specified above. [4 marks]
    Successfully implement task 2 specified above. [4 marks]
    Successfully implement task 3 specified above. [4 marks]
    Successfully implement task 4 specified above. [4 marks]
    Successfully implement task 5 specified above. [4 marks]
    Successfully implement task 6 specified above. [4 marks]
    Successfully implement task 7 specified above. [4 marks]
    Successfully implement task 8 specified above. [4 marks]
    Successfully implement task 9 specified above. [4 marks]
    Successfully implement task 10 specified above. [4 marks]
    Successfully implement task 11 specified above. [5 marks]
    Successfully implement task 12 specified above. [5 marks]

    Feedback on your performance will address each of these criteria.

    A student can expect to receive a distinction (70-100%) if they correctly implement all
    tasks.
    A student can expect to receive a merit (60-69%) if they correctly implement most
    tasks without major errors.
    A student can expect to receive a pass (50-59%) if they correctly implement some
    tasks without major errors.
    A student can expect to receive a fail (0-50%) if they fail to correctly implement some
    tasks without major errors.

    IMPORTANT – All code submitted must be written in Python 3 and use the pyro5
    library to implement remote objects. The only additional software libraries which can
    be used are pyro5 and those in the Python standard library. For example, you can
    use datetime but not pandas and other database systems.

  • Feedback and suggestion for future learning
  • Feedback on your coursework will address the above criteria. Feedback and marks
    will be returned on Monday 23 May 2022 via Learning Central. Where requested,
    this will be supplemented with oral feedback.

    • Cardiff School of Computer Science and Informatics
    • Coursework Assessment Pro-forma
      Submission Instructions
      Assignment
      Learning Outcomes Assessed
      Criteria for assessment
      Feedback and suggestion for future learning

    import sys
    import Pyro5.errors
    from Pyro5.api import Proxy
    # Check that the Python file rental.py exists.
    import os.path
    if(os.path.isfile(“rental.py”)==False):
    print(“Error you need to call the Python file rental.py!”)
    # Check that the class is called rental. That is, the file rental.py contains the expression “rental(object):”
    file_text = open(‘rental.py’, ‘r’).read()
    if(“rental(object):” not in file_text):
    print(“Error you need to call the Python class rental!”)
    sys.excepthook = Pyro5.errors.excepthook
    rental_object = Proxy(“PYRONAME:example.rental”)
    rental_object.add_user(“Conor Reilly”, 123456)
    print(rental_object.return_users())
    rental_object.add_manufacturer(“BMW”, “Germany”)
    print(rental_object.return_manufacturers())
    rental_object.add_rental_car(“BMW”, “3 Series”)
    print(rental_object.return_cars_not_rented())
    print(rental_object.rent_car(“Conor Reilly”, “3 Series”, 2019, 1, 3))
    print(rental_object.return_cars_rented())
    rental_object.end_rental(“Conor Reilly”, “3 Series”, 2019, 2, 4)
    rental_object.delete_car(“3 Series”)
    rental_object.delete_user(“Conor Reilly”)
    print(rental_object.user_rental_date(“Conor Reilly”, 2010, 1, 1, 2029, 2, 1))

    Course Scholar
    Calculate your paper price
    Pages (550 words)
    Approximate price: -

    Why Work with Us

    Top Quality and Well-Researched Papers

    We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

    Professional and Experienced Academic Writers

    We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

    Free Unlimited Revisions

    If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

    Prompt Delivery and 100% Money-Back-Guarantee

    All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

    Original & Confidential

    We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

    24/7 Customer Support

    Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

    Try it now!

    Calculate the price of your order

    Total price:
    $0.00

    How it works?

    Follow these simple steps to get your paper done

    Place your order

    Fill in the order form and provide all details of your assignment.

    Proceed with the payment

    Choose the payment system that suits you most.

    Receive the final file

    Once your paper is ready, we will email it to you.

    Our Services

    No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

    Essays

    Essay Writing Service

    No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

    Admissions

    Admission Essays & Business Writing Help

    An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

    Reviews

    Editing Support

    Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

    Reviews

    Revision Support

    If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.