(12 points)
The germ's genotype consists of an int array with five elements. The germs procreate only by coupling. The genotype of a child is determined by the genotype of its parents according to the following formula: childGenotype[i] = (fatherGenotype[i] + motherGenotype[i])%17, when i = 0, 1, 2, 3, 4.
(15 points)
(14 points)
public String readLine()The end of a file is indicated with a null value.
You also have the class Outputfile at your disposal to write text files. The class has the constructor Outputfile(String name). The file name is given as parameter. The following accessor is used to write the lines:
public void writeLine(String line)
Both the creation of both files and the reading and writing operations may cause the exception Exception.
Write interactive program CopyChristmasLines, which starts by asking for the names of two files, the input file and the output file. Then the program makes a copy of the input file. The copy only contains copies of the input file lines where one or more of the words "Christmas", "tree", "Santa" or "porridge" appear. The other file name that was asked for, the output file, is the name of the copied file.
The program CopyChristmasLines has to handle any Exception exceptions possibly caused by creating and using the file in a sensible and user-friendly way.
(12 points)