HVFrancis / WritingImplements

A simple Java project to model things to write with.
0 stars 25 forks source link

Clean Up Chalk.java #41

Open HVFrancis opened 2 years ago

HVFrancis commented 2 years ago

This class was left a bit of a mess from a previous developer. Make these fixes.

The two new fields should be color and length, not color and shape.

The constructor needs three fields: width/pointSize, color, length. (It wouldn't take a parameter for bodyMaterial, since it's "chalk"!). In addition to "chalk", width should be passed to the super constructor as well. The constructor should then assign the remaining fields.

The new fields need accessors. And length needs a mutator. (Boring would be a set method. Exciting would be a method that shrinks the length of the chalk every time it writes.