Question: 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

Class structure ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- 1a) Write a Java class Country to represent

-------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------

a country that is a member of the European Union. The class

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!