Create a four-class program – a single array of contestant objects with inheritance – some contestants have donated and some have not.

  • UI class , manager class, contestant class and donor class which is a sub class of contestants

Contestants – Fields and datatypes

  • number – int, gender – char, title – String, firstName – String, initial – String, lastName – String,
  • address – String, state – String, password – String, date of birth – LocalDate ,

Donors – Additional fields and datatype

  • credit card – String, amount of money donated – double

NOTE: This is what the text file looks like. The date in the text file is in the default format for the datatype LocalDate (yyyy-MM-dd)

 9#female#Ms.#Val#D.#Galle#"600 Edselle Road"#CA#ieShahho4ai#1995-11-03
 2#male#Mr.#David##Miller#"3 Lynn Ogden Lane"#TX#Zohz3ioVoo#1968-07-30#Master#6734.98
 7#male#Mr.#Edward#E.#Lawson#"4 Clearview Drive"#CO#ek5no4Zoo#1973-09-01#Master#23876.87

Click here for text file

Bare Bones – Here is version one of the four class program

UI Class with the main method – creates the manager object

Manager class

Contestants class

Donors class which is a subclass of Contestants

Bare Bones – Here is version two of the four class program

  • Get rid of the unnecessary full stops and inverted commas in the text file.
  • Not every contestant has a middle initial.
  • Gender is a single letter  – should be a capital letter 🙁  See below.
  • Not all the fields are included in the toString methods.

OUTPUT:

The UI Class with the main method which creates the manager object

The Manager class reads in the text file using its constructor method and prints out all the records using the displayAll method

The Contestants with the constructor method and the toString method

The Donors which is a subclass of Contestants with the constructor method and toString method

NOTE:

  • You must know the bubble sort algorithm.
  • Here to find duplicates in your array.
  • How to remove a duplicate record in the array.

Bare Bones – Here is version three of the four class program

(to follow)