Programming tasks

Programming tasks

III. Programming tasks

While working on the tasks below, you are free to request assistance on D2L at:

Communications / Discussions / Assignments (or other appropriate sub-topic)

These tasks entail modifying your prior code for

1.  Modify your code so that the switch statement entails cases that call separate shape generating methods. Now, the methods must be members of separate classes – Square, Triangle, Diamond – that descend from the abstract class Shape. All code is still to be in a single java file.

2.  Within your code, demonstrate the use of these method concepts (to get credit, make sure your comments indicate each one.):

• overloading some class method (not constructor)

• accessor (getter)

• mutator (setter)

• constructor overloading

3.  Create an interface DisplayCharacters and another class ShapeCharacter.  ShapeCharacter contains a method for displaying either the default alphabet or the user's selected character to comprise a shape. Keeping with object oriented principles, the ShapeCharacter class is distinct from the Shape class, so Shape can only make use of ShapeCharacter's display method if ShapeCharacter implements an interface.  Consider that implementing an interface is not the same as using it in the client. 

4.  Have the default characters in #3 be random by using an instance of the Random class.  You will need to do some research.  See  8  /docs/api/java/util/Random.html

The default characters should be a random selection of the alphabet, both upper and lower case letter.

Your score depends on several tasks. 

Compiling / Running:

1. (10%) The program compiles without error, runs and pertains to this final project.

The following numbered items are 3.33% each and total 90% (They may be combined):


2. Name of program, author, purpose/description, date, any special instructions for user about compiling and running. 

3. Throughout the code, comments and/or relevant component names should attempt to make the program understandable.

4. Explain use of access modifiers (public, private, …) for your methods and variables. 

5. Comments to labels each task below (for example:  // item #4 ).

6. Indicate where at least one case of “encapsulation” occurs and explain what it means to your program.

User input:

7. User input and/or control (can be in applet or system terminal – command-line)


8. Display graphic output: program generates at least 3 designs (can be in either applet or character art in the system terminal)

Object oriented programming:

9. At least 1 parent shape class

10. At least 3 shape child classes

11. Distinct class for driver/controller

12. Create an interface, implement it and use it

13. Overloading of method of one class (created by you) in another class

14. Overloading of constructor of class (created by you)

15. Accessor

16. Mutator
Powered by