Write the Division class so that the given code provides the expected  output. You can not change the given code. dhaka = Division() print('----------------------------------') dhaka.printDetail() print('----------------------------------') dhaka.add_district("Narayanganj", "Gazipur") print('----------------------------------') dhaka.setName("Rangpur") print('----------------------------------') dhaka.setName("Dhaka") dhaka.add_district("Narayanganj") dhaka.printDetail() print('----------------------------------') dhaka.add_district("Gazipur", "Munshiganj") dhaka.printDetail() print("===================================") chittagong = Division("Chittagong") chittagong.add_district("Feni", "Comilla", "Cox's Bazar") chittagong.printDetail() print("===================================") sylhet = Division("Sylhet") sylhet.add_district("Habiganj") sylhet.printDetail() Expected Output: ---------------------------------- Name of division is not set ---------------------------------- You must set name of division first before adding district ---------------------------------- Invalid name. Name must be among "Dhaka", "Sylhet", or "Chittagong" ---------------------------------- Division: Dhaka Districts: ['Narayanganj'] Neighbour Divisions: Sylhet Chittagong ---------------------------------- Division: Dhaka Districts: ['Narayanganj', 'Gazipur', 'Munshiganj'] Neighbour Divisions: Sylhet Chittagong =================================== Division: Chittagong Districts: ['Feni', 'Comilla', "Cox's Bazar"] Neighbour Divisions: Dhaka Sylhet =================================== Division: Sylhet Districts: ['Habiganj'] Neighbour Divisions: Dhaka Chittagong SOLVE WITHIN 40 MINS SIR PLEASE

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write the Division class so that the given code provides the expected 
output. You can not change the given code.

dhaka = Division()
print('----------------------------------')
dhaka.printDetail()
print('----------------------------------')
dhaka.add_district("Narayanganj", "Gazipur")
print('----------------------------------')
dhaka.setName("Rangpur")
print('----------------------------------')
dhaka.setName("Dhaka")
dhaka.add_district("Narayanganj")
dhaka.printDetail()
print('----------------------------------')
dhaka.add_district("Gazipur", "Munshiganj")
dhaka.printDetail()
print("===================================")
chittagong = Division("Chittagong")
chittagong.add_district("Feni", "Comilla", "Cox's Bazar")
chittagong.printDetail()
print("===================================")
sylhet = Division("Sylhet")
sylhet.add_district("Habiganj")
sylhet.printDetail()

Expected Output:
----------------------------------
Name of division is not set
----------------------------------
You must set name of division first before adding district
----------------------------------
Invalid name. Name must be among "Dhaka", "Sylhet", or "Chittagong"
----------------------------------
Division: Dhaka
Districts: ['Narayanganj']
Neighbour Divisions:
Sylhet
Chittagong
----------------------------------
Division: Dhaka
Districts: ['Narayanganj', 'Gazipur', 'Munshiganj']
Neighbour Divisions:
Sylhet
Chittagong
===================================
Division: Chittagong
Districts: ['Feni', 'Comilla', "Cox's Bazar"]
Neighbour Divisions:
Dhaka
Sylhet
===================================
Division: Sylhet
Districts: ['Habiganj']
Neighbour Divisions:
Dhaka
Chittagong

SOLVE WITHIN 40 MINS SIR PLEASE

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY