Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Class structure ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- 1a) Write a Java class Country to represent a country that is a member of the European Union. The class should
Class structure
-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
1a) Write a Java class Country to represent a country that is a member of the European Union. The class should have three instance variables that capture a country s name, the year it joined the EU, and whether it uses the Euro as its currency, a constructor that sets up each of these variables (no error-checking is required), accessor methods for each of these variables, and a mutator method for the Euro variable. (4 marks) 1 b) Write a Java class EU to represent the member countries of the European Union. The class should have one instance variable that contains information about the member countries; an accessor method that takes an integer and that returns the corresponding Country object, a method newMember that takes a country object and updates the instance variable appropriately and a method needFX that takes two Country objects and returns true iff you need to change currency when moving from one to the other (6 marks)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