WARNING: Dodona is only used for submission and not for giving feeback.
This means that after submission your code is compiled but not tested. Every last
submission will be manually evaluated and considered as your final exam submission.
Part 4 – Object-oriented solution Economic Data (4 points)
Create a new Python file in which you rewrite your complete solution for
part 2 and 3 of Economic Data Exercise but now using object orientation:
- class name: EconomicData
- Store all data as attributes
- Turn your functions into methods (e.g. self.gdp_per_capita()) that use the instance
variables
- Add a report() method to display the full formatted report
Part 5 - Instantiate EconomicData classes (1 point)
Create an instance for Belgium (see part 1) and for Spain:
- country_name = Spain
- gdp = 1490000000000
- population = 47500000
- inflation_rates = 1.8, 1.0, 3.1, 5.7, 3.5
- unemployment_rates = 14.1, 13.8, 13.3, 12.6, 11.7
- prices bread = 1.10, 1.12, 1.15, 1.13, 1.16