Professional Documents
Culture Documents
This lab test is divided into FIVE stages Stage 1, Stage 2, Stage 3, Stage 4 and Stage 5.
You need to complete prior stages without errors before you can proceed to the respective next
stages.
To do this lab test you are provided with five files Tester1.java, Tester2.java,
Tester3.java, Tester4.java and Tester5.java.
1. Create a folder on Desktop and name the folder using your matric number.
2. Open eclipse and set the folder named using your matric number as your workspace.
Problem Background
There is a rumor circulating on the internet that George Lucas (the creator of the Star Wars movies)
uses a formula to create the names for the characters in his stories (Jar Jar Binks, ObiWan Kenobi,
etc.). The formula allegedly is this:
Your clan:
Given the Clan array {"Bear", "Boma", "Clawmouse", "Dragon", "Hawkbat", "Heliost", "Katarn",
"Wolf", "Savrip", "Squall", "Thranta"}. Your clan will take the ith position which is determined by
the size of your birthplace String. If it has the same size or is larger than the size of the Clan array, i
becomes the size of birthplace/2.
Stage 1
You have been asked to develop a program to manage a list of Star Wars Fan Club members.
Therefore, the first thing that you need to do is to define a class to create an object of a Star Wars Fan
Club member:
1. Create a Java project named LabTest1-B-Stage1.
i. Instance variables to hold the first name, last name, mothers maiden name, place of birth, Star
Wars first name, Star Wars last name and Star Wars clan name of a member.
ii. A suitable constructor to assigns the value of the instance variables in 3(i).
iii. Suitable methods to access the instance variables in 3(i) from outside of the class.
4. Check your answer by invoking the main method in class Tester1, and your output should be
as follows:
Member details
--------------
First name: Wannabe
Last name: Obirus
Mother's maiden name: Keneddy
Place of birth: Obidos
Star Wars first name: null
Star Wars last name: null
Star Wars clan: null
Stage 2
Next, you need to define a class to create an object to manage the Star Wars Fan Clubs list of
members:
1. Create a Java project named LabTest1-B-Stage2.
2. Copy class Tester2.java and Member.java (from stage 1) into your project.
4. Check your answer by invoking the main method in class Tester2, and your output should be
as follows:
The program needs a feature to add a new member into the clubs list of members. Therefore, you
need to:
1. Create a Java project named LabTest1-B-Stage3.
*Take note that the method must return true if the addition of a new member is successful, or
return false if otherwise.
4. Check your answer by invoking the main method in class Tester3, and your output should be
as follows:
Addition of new member Wannabe Obirus has been succesfully executed
Addition of new member Muneerah Azlan has been succesfully executed
Addition of new member Wannabe Obirus has failed because person has been
added before
Stage 4
The second feature that program needs is a feature to generate the Star Wars first name and last name
for a member of the club. To implement this feature, you need to:
1. Create a Java project named LabTest1-B-Stage4.
3. Add into class Member the suitable methods (setter) to assign a members Star Wars first name
and last name.
4. Add into class StarWarsFanClubRegister a suitable method to generate and assign a
members Star Wars first name and last name, based on the alleged formula that George Lucas used.
*Take note that you need to use one of following methods in the String class to implement this
method.
5. Check your answer by invoking the main method in class Tester4, and your output should be
as follows:
Addition of new member Wannabe Obirus has been succesfully executed
Addition of new member Muneerah Azlan has been succesfully executed
Addition of new member Wannabe Obirus has failed because person has
been added before
Addition of new member Julia Roberts has been succesfully executed
The final feature that program needs is a feature to generate the Star Wars clan for a member of the
club. To implement this feature, you need to:
1. Create a Java project named LabTest1-B-Stage5.
3. Add into class Member a suitable method to assign a members Star Wars clan.
5. Check your answer by invoking the main method in class Tester5, and your output should be
as follows: