Question: JAVA classes Problem public class Problem_0020{ /** * Note: In this problem level you will use inner classes by defining custom classes * inside the

JAVA classes Problem

public class Problem_0020{ /** * Note: In this problem level you will use inner classes by defining custom classes * inside the Problem_0020 class. This is only done so you can submit multiple * classes in a single java file on AutoLab. In most cases it is better practice to define * each class in a separate file instead of using inner classes. * */ /** * q1: Write a public class named VideoGetSet with the following public getter (accessor) and * setter (modifier) methods in the standard format shown in class such that after calling * one of the setter methods with a particular value the corresponding getter method will * return the same value in each instance (object) of the class. You will need to create * instance variables in the VideoGetSet class to achieve this functionality. * getter: "getRegular" setter: "setRegular" type: "ArrayList" * getter: "getContemporary" setter: "setContemporary" type: "HashMap" * getter: "getTen" setter: "setTen" type: "double" * getter: "getReligious" setter: "setReligious" type: "double" */ /** * q2: Write a public class named RegularGetSet with the following public getter (accessor) * and setter (modifier) methods in the standard format shown in class such that after * calling one of the setter methods with a particular value the corresponding getter method * will return the same value in each instance (object) of the class. You will need to create * instance variables in the RegularGetSet class to achieve this functionality. * getter: "getAggressive" setter: "setAggressive" type: "double" * getter: "getSurprising" setter: "setSurprising" type: "HashMap" */ /** * q3: Write a public class named RespondentInts with the following. * -A public constructor that takes 2 doubles as inputs. * -A public method named compute that takes no parameters and returns the the absolute value * of the first constructor input to the power of the the absolute value of the second * constructor input as a double. You will need to store the constructor input in instance * variables to be able to access them in the compute method */ /** * q4: Write a public class named BlameChar with the following * -A public constructor that takes 2 Strings. The Strings should be stored in instance * variables * -A public method named replaceChar that takes no parameters and has return type void. This * method removes all instances of the character "s" from the instance variable storing the * String that was the first parameter in the constructor call * -An overridden toString method that returns the stored strings separated by spaces. This * includes all the Strings from the constructor call and if replaceChar was called on this * instance then the first String will not contain any instances of "s" */ /** * q5: Write a public class named JournalismChar with the following * -A public constructor that takes 4 Strings. The Strings should be stored in instance * variables * -A public method named replaceChar that takes no parameters and has return type void. This * method removes all instances of the character "o" from the instance variable storing the * String that was the third parameter in the constructor call * -An overridden toString method that returns the stored strings separated by spaces. This * includes all the Strings from the constructor call and if replaceChar was called on this * instance then the third String will not contain any instances of "o" */ public static void main(String[] args){ /* Use the following syntax to instantiate your inner class for testing */ ProblemSet_agkahane_0020 outerInstance = new ProblemSet_agkahane_0020(); //InnerClassName innerInstance = outerInstance.new InnerClassName(); /* Test your code here to verify it is correct before submitting */ } }

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!