Chat with us, powered by LiveChat Implement the following class diagrams and write a main class to test all these classes. ??? Each class implements the display method of the Displayable abstract class and the method should dis | Wridemy

Implement the following class diagrams and write a main class to test all these classes. ??? Each class implements the display method of the Displayable abstract class and the method should dis

 Implement the following class diagrams and write a main class to test all these classes.

 ● Each class implements the display method of the Displayable abstract class and the method should display all the current object’s and its superclass object’s information. Keep in mind, you should avoid code redundancy.

 ● Define appropriate __init__ method so that all the objects can be created properly.

 ● Define appropriate getters and setters using @property if needed for other classes’ methods. However, do not add any public or protected property or public get method for the private attribute ‘parts’ in the Machine class. 

Question Implement the following class diagrams and write a main class to test all these classes.

● Each class implements the display method of the Displayable abstract class and the method should display all the current object’s and its superclass object’s information. Keep in mind, you should avoid code redundancy.

● Define appropriate __init__ method so that all the objects can be created properly. ● Define appropriate getters and setters using @property if needed for other classes’ methods. However,

do not add any public or protected property or public get method for the private attribute ‘parts’ in the Machine class.

The main method for unit testing. def main():

robo = Robot('MTX', 'M1X', 'F-16', 10000) robo.add_part(Part(111, 100)) robo.add_part(Part(222, 200)) robo.add_part(Part(333, 300)) robo.add_part(Part(222, 300)) robo.add_part(MovablePart(555, 300, "TypeA")) robo.add_part(Part(111, 100)) robo.add_part(Part(111, 100)) robo.add_part(MovablePart(777, 300, "TypeB")) robo.add_part(MovablePart(655, 300, "TypeA")) robo.add_part(MovablePart(755, 300, "TypeA")) robo.add_part(MovablePart(977, 300, "TypeB"))

robo.display() print()

print("nRobot test flight—-") robo.fly()

print("nRobot dowork() test —-") robo.dowork()

print("nDuplicated part list—-") partfreq = robo.find_duplicated_parts() for partno in partfreq.keys():

print(partno,'=>', partfreq[partno], 'times')

print("nExpensive part list—-") expensive_parts = robo.get_expensive_parts(200) for part in expensive_parts:

part.display()

print("nMovable part list—-") movable_parts = robo.get_movable_parts_bytype() for type, parts in movable_parts.items():

print("type =", type) for part in parts:

part.display() print()

print("nAsk movable to move—-") movable_parts = robo.get_movable_parts() for part in movable_parts:

part.move()

print("nTest remove_part() —-") robo.remove_part(333) for part in robo:

if part.partno == 333: print('Found 333') break;

The Expected output cpu = M1X machine_name = MTX The machine has these parts: partno = 111 price = 100

partno = 222 price = 200

partno = 333 price = 300

partno = 222 price = 300

partno = 555 price = 300 type = TypeA

partno = 111 price = 100

partno = 111

price = 100

partno = 777 price = 300 type = TypeB

partno = 655 price = 300 type = TypeA

partno = 755 price = 300 type = TypeA

partno = 977 price = 300 type = TypeB

model = F-16 speed = 10000

Robot test flight—- The JetFigher F-16 is flying in the sky! The Robot MTX is flying over the ocean!

Robot doWork() test —- The Robot MTX is assembling a big truck.

Duplicated part list—- 111 => 3 times 222 => 2 times

Expensive part list—- partno = 222 price = 200 partno = 333 price = 300 partno = 222 price = 300 partno = 555 price = 300 type = TypeA partno = 777 price = 300 type = TypeB partno = 655 price = 300 type = TypeA partno = 755 price = 300 type = TypeA partno = 977 price = 300 type = TypeB

Movable part list—- type = TypeA partno = 555 price = 300 type = TypeA partno = 655 price = 300 type = TypeA partno = 755 price = 300 type = TypeA

type = TypeB partno = 777 price = 300 type = TypeB partno = 977 price = 300 type = TypeB

Ask movable to move—- partno: 555 is moving fast! partno: 777 is moving fast! partno: 655 is moving fast! partno: 755 is moving fast! partno: 977 is moving fast!

Test remove_part() —-

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Wridemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order

Related Tags

Academic APA Writing College Course Discussion Management English Finance General Graduate History Information Justify Literature MLA