Answered step by step
Verified Expert Solution
Link Copied!

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 (countries.xml, 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:
1. Enter new country
2. Exit.
Choice: ___
Or you can ask:
Enter in another country?(y/n): ___
Note that the program will create an element with sub-elements 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
66.99
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 0.
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 __name__=="__main__":
main()

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

ISBN: 3319234609, 978-3319234601

More Books

Students also viewed these Databases questions