Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your tasks for this assignment are in two parts. You will need to create class definition of your own to keep track of the countries

Your tasks for this assignment are in two parts. You will need to create class definition of your own to keep track of the countries of the world, and use that definition is sample software, similar to the way the Book class is used in sample software in this module.

Part 1

First create a single .py file that contains both the Country class definition and then a main program that uses instances of that class, similar to the way classSample.py works. The Country class should have the following properties:

* name of the country (string data)

* population of the country (integer data)

* name of the country's capital (string data)

* population of the capital (integer data)

The Country class should have:

* an initializing constructor. You can decide which properties are initialized.

* a toString() method that prints the data for the country. You can decide on the format of the output.

* at least two other methods, one of which should include input. For example, you could have a method that allows a user to update the population of a country, or any other property of the Country.

The software that uses instances of the class should create at least two different instances of a Country, and should include Python instructions testing all of the methods in your class and demonstrating that they work properly.

Part 2

You should decouple the software you created in Part 1 by putting the Class definition in its own file, with the software that uses instances of the class in a separate file, similar to the way myprogram.py uses bookClass.py. You do not need to create new software from scratch for this part of the assignment -- you can use the same software from Part 1, but it should be packaged in two different files.

Your software should be properly documented.

You should submit all three .py files -- the first file with both class definition and the software using instances of the class in the same file, and the two files with the same software using the class as a decoupled class.

Please show the input and output in Python file without syntax errors. I wanna see it in python form

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe a persuasive message.

Answered: 1 week ago

Question

Identify and use the five steps for conducting research.

Answered: 1 week ago

Question

List the goals of a persuasive message.

Answered: 1 week ago