Explain the code you wrote and any problems you encountered and how you fixed them.

This is a project, it requires you to write a basic Java classes with attributes and methods. Methods
required include an alternate constructor, methods to display output and methods to read user input.
Code must be written that creates objects and then calls methods for these objects

The assessment will be composed of three (3) parts: the scenario, the code and
explanation

The scenario:
You will decide on the scenario and develop a back story for your program –
it could be a game of
some sort or simply display some information about your chosen things in a specific way.

Choose two objects – they could be your favourite things e.g. a book, a game, an animal (real or
imaginary), a character (real or imaginary) etc.

Some example scienarios

eg. student studying subjects; Customers make orders, customers buy products from shop, students borrow books from library, player playing games, players play sports games, etc.
The code:
Create two classes (class1 & class2, one for each thing – choose a good name for each class), for
each class:
Identify at least 3 attributes – an int/double, a String, a boolean and a constant must be
present in at least one of the classes.
Design an alternate constructor.
Create the accessors and mutators for each attribute.
Design a suitable toString()

Create a main class (choose a name for it). Create a Scanner object as a local variable in the main
class – where ever it is needed. The main class creates an object of class1 and an object of class2 as
attributes – choose appropriate names for them. The default constructor should initialse both objects.
Each object’s contents should be displayed using the toString().

User entry must change both objects in some way (using mutators).
User must be presented with a decision and the response processed appropriately using an if
statement.
Use multiple methods in the main class – where appropriate.

Explain the code you wrote and any problems you encountered and how you fixed them. At
minimum you need to identify :
Basic Class structure – what does a class have
Attributes – what attributes did you choose for each class and why
Alternate constructors – what parameters did you chose and why
Non-void and void methods – which methods are void and non-void and why
Accessor – which methods are accessors
Mutators – which methods are mutators
Access modifiers – what modifiers are used in your code and why
Constants – which values are stored as constants, what modifier did you use and why
toString() – what attributes did you include and why
Scanner – identify the scanner methods you used and why
if statements – document any if statements you used and how they support decisions

You also need to include at least 1 screen shot of your code being testing on the object bench.

The program we use for coding is BlueJ please do the code in this software

Last Completed Projects

topic title academic level Writer delivered