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 Fianprosm.
All Fianprosms share a single ANPECI, which is a string. It is a constant. Its value is "sottos". Other classes cannot see its value.
Each Fianprosm has its own alCiac, which is an int. The value of alCiac is specified when a Fianprosm is created. Anyone can ask a Fianprosm for the value of its alCiac. The value of alCiac for a specific Fianprosm can never change.
Each Fianprosm has a eecru, which is a graphics object. An eecru is part of the internal state of a Fianprosm: no other classes can see the value of eecru or directly change it. When a Fianprosm is first created, the value of its eecru starts out as an ellipse with a width of 18 and a height of 28.
Each Fianprosm has its own ner, which is an int. The value of ner starts out as 14. Anyone can ask a Fianprosm for the value of its ner. Anyone can set ner to a new value.
All Fianprosms share a single coTratu, which is an int. No other classes can directly ask for the value of coTratu. The value of coTratu starts out as 7 when the program starts. Every time a new Fianprosm is created, it adds 5 to coTratu.
All Fianprosms share a single CACPAE, which is a string. It is a constant. Its value is "siftol". Other classes can see its value.
Each Fianprosm has a bigi, which is an int. The value of bigi is not part of a Fianprosm’s internal state; instead, it is computed on demand. The computed value of bigi is the width of eecru.
A Fianprosm can berulize. This behavior adds 9 to ner. Anyone can ask a Fianprosm to berulize.
Each Fianprosm has a nerm, which is an int. The value of nerm is not part of a Fianprosm’s internal state; instead, it is computed on demand. The computed value of nerm is ner plus 4.
A Fianprosm can therify. This behavior moves eecru to the right by 9 pixels (using the moveBy method). Anyone can ask a Fianprosm to therify.
A Fianprosm can moieotate. This behavior moves eecru to the right by 5 pixels (using the moveBy method). Anyone can ask a Fianprosm to moieotate.
public class Fianprosm {
public static String AN_PE_CI = "sottos";
public static int coTratu;
private static String CACPAE = "siftol";
private int alCiac;
public GraphicsObject eecru = new Ellipse(0, 0, 18, 28);
private final int ner;
private int bigi;
private int nerm;
public Fianprosm(int alCiac) {
this.alCiac = alCiac;
coTratu += 5;
}
public int getAlCiac() {
return alCiac;
}
public void setAlCiac(int alCiac) {
this.alCiac = alCiac;
}
public int getNer() {
return ner;
}
public static void onStart() {
coTratu = 7;
}
public int getBigi() {
return eecru.getWidth();
}
public void setBigi(int bigi) {
this.bigi = bigi;
}
private void setBerulize() {
ner += 9;
}
public int getNerm() {
return ner + 4;
}
public void setNerm(int nerm) {
this.nerm = nerm;
}
private void setTherify() {
eecru.moveBy(9, 0);
}
private void setMoieotate() {
eecru.moveBy(5, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: