Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a simple UI main that asks for the name, population and continent where a country on earth exists. Once they enter that information in
Create a simple UI main that asks for the name, population and continent where a country on earth exists. Once they enter that information in it should get saved out to an XML file. Call the file whatever you would like countriesxml etc.
The program should loop again to continue entering in more than one country. You can have it loop in two ways. Give them a menu options:
Enter new country
Exit.
Choice:
Or you can ask:
Enter in another country?yn:
Note that the program will create an element with subelements and add the larger element within the root element of the XML file.
The XML file will have a root element called 'nations'. Inside the 'nations' element will be a sequence of 'country' elements. The country elements will contain name, population, and continent elements. An example of the XML file might look like this.
France
Europe
Note that population values are measured in millions
You can start by creating the file with the root element or having no file existing and creating the root element within the python code.
Your submission MUST include these file:
main.py must have main function in it Failure to include main function in your submission will result in
You can include more classes or functions if you would like, but these are minimum requirements.
Main function Ex:
def main:
# your logic here
if namemain:
main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started