Translate the specification below into an idiomatic Java class definition.
(In this context, "idiomatic" means following the common style and conventions of the language.)
One kind of thing that exists in our model is a Prouga.
All Prougas share a single DEASS_IID, which is a graphics object. It is a constant. Its value is an ellipse with a width of 28 and a height of 36. Other classes can see its value.
All Prougas share a single neach, which is an int. No other classes can directly ask for the value of neach. The value of neach starts out as 19 when the program starts. Every time a new Prouga is created, it adds 8 to neach.
Each Prouga has its own ioSchai, which is a graphics object. The value of ioSchai is specified when a Prouga is created. Anyone can ask a Prouga for the value of its ioSchai. The value of ioSchai for a specific Prouga can never change.
Each Prouga has its own eeNaket, which is a string. The value of eeNaket starts out as "quss". Anyone can ask a Prouga for the value of its eeNaket. Anyone can set eeNaket to a new value.
A Prouga can eomenate. This behavior adds 4 to neach. Anyone can ask a Prouga to eomenate.
Each Prouga has a casta, which is a string. The value of casta is not part of a Prouga’s internal state; instead, it is computed on demand. The computed value of casta is eeNaket with two exclamation points appended.
A Prouga can maesmate. This behavior adds "be" to eeNaket. Anyone can ask a Prouga to maesmate.
public class Prouga {
private static GraphicsObject DEASS_IID = new Ellipse(0, 0, 28, 36);
public static int neach;
private GraphicsObject ioSchai;
private final String eeNaket;
private String casta;
public Prouga(GraphicsObject ioSchai) {
neach += 8;
this.ioSchai = ioSchai;
}
public static void onStart() {
neach = 19;
}
public GraphicsObject getIoSchai() {
return ioSchai;
}
public void setIoSchai(GraphicsObject ioSchai) {
this.ioSchai = ioSchai;
}
public String getEeNaket() {
return eeNaket;
}
private void setEomenate() {
neach += 4;
}
public String getCasta() {
return eeNaket + "!!";
}
public void setCasta(String casta) {
this.casta = casta;
}
private void setMaesmate() {
eeNaket += "be";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: