Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1a) Write a Java class Country to represent a country, for tracking membership of the United Nations. The class should have o three instance variables
1a) Write a Java class Country to represent a country, for tracking membership of the United Nations. The class should have o three instance variables that capture o the country's name, its status with respect to the UN (either not a member, or a member of the General Assembly, or a temporary member of the Security Council, or a permanent member of the Security Council), and whether it has paid its UN membership dues; a constructor that sets up each of these variables (with appropriate error-checking on the status variable); accessor methods for each of these variables; and a mutator method for the status variable. (5 marks) o . 1b) Write a Java class UN to represent the member countries of the United Nations. The class should have one instance variable that holds information about the member countries; a constructor that sets up this variable; an accessor method that takes an integer and that returns the corresponding Country object; a method newMember that takes a Country object and updates all instance variables appropriately; and a method sameStatus that takes two country objects and returns true iff they have the same status in the UN
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