Assignment
Assignment
4.Create Main class with content call the function f1, f2, f3, f4 in MyLand class,
object of the list read from file data.txt same as Lab 4 given.
f1 - Sort the list by price increase if 2 objects have the same price, sort by charAt(3)
in the owner and print out following format (owner,adress,price)
f2 – Find in the List if have more 1 Lands with the same price and address, Add a
number after owner. Ex
f3. In the input data.txt file, suppose has only one Land for f3 function. If have the
digits in the address print out number of square number in this and print out
following by format: ex1:
Ex2:
f4. Find the first most frequent word in the Address (word= a string with out space).
Replace it with character ‘C’. the outout of f4 as example:
1
(ha, C nha 72a - ngach C 3- duong C 3 Khu do thi xa la – Ha Dong, 1500)