Professional Documents
Culture Documents
ASSIGNMENT 5 INSTRUCTIONS
Submit all of your assignments in a zip file. Your zip file must include the .java and .class files as
well as a Word document with a screen shot of your program running.
Assignment 5-1 (25 pts.) Lab Practice 7
Lab 9-4 (5 pts.) Create 2 new methods in 2 different classes. Using the supplied
VacationScaleTwo class, add the method displayVacationDays() and implement it using a
for loop. Test your class with the VacationScaleTwoTest class. Using the supplied
NamesListTwo class, add a displayNamesTwo() method and use an enhanced for loop to
implement it. Create a NamesTwoListTest class to test your NamesListTwo class.
Lab 9-5 (10 pts.) For this exercise, you are to create a class named
TwoDimensionalArray that declares, instantiates, and displays a two-dimensional array of
integers from 110. Your class should have the following 2 public methods (your 10 x 10
array of integers should be private):
o setArray() this instantiates the array and fills each row of the array with the
numbers 110 in order.
o displayArray() displays the contents of the array like the example below:
Lab 9-6 (10 pts.) Using ClassMapTest as your test class, create the ClassMap class and
implement the following methods:
o setClassMap() initializes an array of String called deskArray. deskArray should
be a private instance variable within ClassMap. Set the size of deskArray to 10
using a constant named NUMBER_DESKS.
o setDesk() assigns the name of the student to the current position of deskArray.
The name of the student is found in the public instance variable name.
Page 1 of 2
BMIS 312
Lab 9-6 Conversion (10 pts.) overload the setDesk() and searchDesk() methods to
accept a String variable called name and use this variable to set the ClassMap instance
variable name. Since you are overloading these 2 methods, you should have 1 set of
methods that accepts no arguments and 1 set that accepts a single String argument.
Lab 10-2 (15 pts.) Write a Customer class with an overloaded method called
setCustomerInfo(). You must overload setCustomerInfo() 3 times (in other words, you
must have 3 different setCustomerInfo() methods). Use CustomerTest.java to test your
Customer class testing each overloaded method. Write a displayCustomer() method to
display the values for each customer you create in CustomerTest (create at least 3
customers).
Page 2 of 2