Page 1 of 1

SE-1106 HOMEWORK-3 In this homework, you must write a File Processor class that processes a text file. Your class should

Posted: Sat May 14, 2022 7:34 pm
by answerhappygod
Se 1106 Homework 3 In This Homework You Must Write A File Processor Class That Processes A Text File Your Class Should 1
Se 1106 Homework 3 In This Homework You Must Write A File Processor Class That Processes A Text File Your Class Should 1 (47.55 KiB) Viewed 27 times
SE-1106 HOMEWORK-3 In this homework, you must write a File Processor class that processes a text file. Your class should have the following methods: countWordsøyletter(String inputFileName, String outputFileName) : Reads the input file and writes the number of words starting from each letter to the given output file. You will omit the letters of zero occurrences. Example: If the input file contains only the the sentence "This is a sample input file for testing then the function must print out to the out file the following A:1 F:2 1:2 5:1 T:2 countWords (String inputFileName} returns the number of words in the given file. • countWord(String inputFileName, String key]: Searches for the given key in the given input file and returns the number of occurrences of the key in the file. filterOut(String inputFileName, String outputFileName. String key: Copies the content of the input file to the output file except the occurrences of the given key. All occurrences of the key must be removed in the output file. filter(String inputfile, String outputFileName, int minWordlength): Copies the content of the input file to the output file except the words whose length is smaller than minWordlength, Implement FileProcessorException dass to represent all exceptions that can be thrown from the methods of the FileProcessor All methods of the FileProcessor class must only throw FileProcessorException instance when any exception is generated. All exceptions generated inside the methods must be caught inside and thrown as a FileProcessorException object. Write a Main class for testing your class. Create a text file "sample.txt" and fill the with an arbitrary text data. Use this file as your input file. Write a main function and call all methods of FileProcessor class. Note : You can check PhoneBookApplication case study for simple text file processing and exceptions.