Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
Question:
Write a file encoding application that can encode and compress text files, and can reverse these back to the original text files. This encoding is part of a possible file compression. The compression implementation will only effectively compress files with very specific characteristics, and not compress others at all. More precisely: only files that have rather long sequences of equal characters in them will benefit from this compression. (It is very similar to compression techniques for pictures, and is only one of many techniques that form part of more professional compression programs).
 
In this assignment you will deal with three file types, identified by file suffixes “.txt”, “.zap” and “.czp”. .txt files are simple ASCII text files. They can be opened, read, and written in any standard text editor. .zap files are files encoded in zap format. zap is a format that we define ourselves for the purpose of encryption and better compression. .czp files (compressed zap) are files that have been converted to zap format and compressed. The file converter you will implement should be able to convert between these three formats.
 
3 The project Your project should have five classes: FileConverter, FileHandler, SimpleEncoder, SimpleDecoder and Compressor. The classes should have at least the following public methods: class FileConverter: public void encode(String filename) public void decode(String filename) public void compress(String filename) public void uncompress(String filename) public void showFile(String filename) public void decodeAndShowFile(String filename) class FileHandler: public List readFile(String filename) public void writeFile(String filename, List chars) class SimpleEncoder: public List encode(List text) class SimpleDecoder: public List decode(List encoded) class Compressor: public List compress(List text) public List uncompress(List text) A short, informal description for each method in the FileConverter class is at the end of this assignment handout.
 
An implementation for the methods in the FileHandler class is also at the end of this handout. You will use a FileHandler object to read and write text files. Texts are lists of Character objects (look this up in the API documentation!). The SimpleEncoder and SimpleDecoder objects are used to translate between human readable texts and encoded texts. A Compressor object allows to compress encoded texts and decompress compressed texts back to encoded texts. In your application, you will make these features available to the end user. 4 Agile approach Implement this project in well chosen steps to quickly gauge your skills and understanding. While you are designing your diagrams, you might want to trial a few code snippets.
 
You should also think about dependencies between the different features. Then further refine your diagrams and/or code and validate your approach, potentially adjusting your way of work. Keep making notes about decisions, epiphanies, alternative solutions, etc. These should be recorded in your journal. 5 zap encoding zap encoding works as follows:
you count how many different characters appear in the original text. Then you write, into the zap file,
• first, the number of distinct characters.
• then, a list of the appearing characters (each once). The position in this list represents a code for the character (the first character has code 0, the second has code 1, and so on).
 
 
• then the code for each character in the order in which they appear in the original text. When these codes are written to the text file, they are written as characters that have the value of the code. That means, for example, to write the character coded as 3 (the third in the list), the character with ASCII code 3 is written to the file. An example: Original text: e n c o d i n g _ c h a l l e n g e zap file: (11) e n c o d i g _ h a l (0)(1)(2)(3)(4)(5)(1)(6)(7)(2)(8)(9)(10)(10)(0)(1)(6)(0) The notation (x) denotes the character with ASCII code x. The order of the list of characters at the beginning is arbitraty, but fixed when characters are assigned their codes. Note: In the current form, this is simply a different encoding.
 
It does not compress the file at all. The idea behind this is that character codes are replaced by smaller numbers, which could then later, when you want to create smarter compression algorithms, be represented in fewer bits. 6 czp compression To produce czp format, the original text is first converted to zap format. Then each continuous sequence of equal characters is replaced by two entries: the character, and the number of occurrences of the character in the sequence. So, for example, instead of writing ‘xxxxxxaaaa’ into a file, you would write x(6)a(4) meaning: six times ‘x’, four times ‘a’. Again, numbers are written as characters with the corresponding code. This will not produce very good compression for most text files, but is useful if the file is in fact an image file. Run-length encoding is similar (but NOT the same) and is further described on Wikipedia
 
7 Steps I strongly recommend you approach the assignment in steps. Step 1 might be to read in a file, and write it out (without conversion) using a different name. Step 2 could be to implement showFile: Read a file and display it on the terminal. Step 3 might be to implement conversion to and from zap format. And so on. 8 Help You can get significant help through the discussion forum and during the lab sessions. The appendix in this handout provides more coding details. You can find these code snippets in a file on EITOnline. You will also find example text files for your project. In general, you need to do research to get good grip on this project. In case these requirements are not clear or you have questions on some details, do discuss them in class/lab to get these clarified. 9 Tasks overview The assignment consists of a number of subtasks.
 
The following tasks need to be carried out before the set deadlines. The results of these tasks need to be uploaded on EITOnline using the correct Assigment 1 Upload Links. Note: One of the tasks is to keep a journal, so don't forget to start this journal right from the beginning. Task Due date Create a Class Diagram of all classes. You need to refine the class relationships, and include multiplicity and visibility (scoping). 11 March 2018 (Week 3) Create Sequence Diagrams for encoding and for compressing as an end-user would initate these. 11 March 2018 (Week 3) Implement the classes and test the individual classes. Make sure your class diagram is in sync with your implementation.
 
Feel free to modify your initial class diagram due to further insight. Modifications should be logged in your journal. 8 April 2018 (Week 7) Keep a journal reflecting on what you have done, when you have done it (date and time), and what your contribution was; what difficulties you encountered (could be technical or non-technical) and how you resolved them (if at all). 8 April 2018 (Week 7) Demonstrate the design and (intermediate) result to the lecturer. All group members are expected to present part of the design and functionality of the application 5 April 2018 (Week 7) 10 Delivery Important: It is your responsibility to make sure you have a backup somewhere else in case something happened to the online facilities at EIT.
 
Hand in Your work is delivered in three separate deliveries: - Hand in a single zip file that contains all required diagrams using the link Assignment 1 Upload Link - Diagrams - Hand in a single zip file that contains your complete Java project and journal using the link Assignment 1 Upload Link - Project - Demonstrate your work to your supervisor during the scheduled lab session. You do not need to hand in anything for the demonstration. You can use the feedback from your supervisor to improve your work before it is handed in. 11 Appendix: some specifications and implementations /** * Encode the specified file into 'zap' format. The file must exist, and * it must be a text file with suffix ".txt". The filename may or may not * include the suffix. If not, the ".txt" suffix is automatically appended.
 
The method creates an encoded file with the same base name and ".zap" * suffix. * * @param filename The file name of the file to be encoded. */ public void encode(String filename) /** * Decode the specified file from 'zap' to 'txt' format. The file must * exist, and it must be a zap-encoded file with suffix ".zap". The * filename may or may not include the suffix. If not, the ".zap" suffix * is automatically appended. The method creates a decoded file with * the same base name and ".txt" suffix. * * @param filename The file name of the file to be decoded. */ public void decode(String filename) /** * Compress the specified file into 'czp' format. The file must exist, and * it must be a text file with suffix ".txt". The filename may or may not * include the suffix. If not, the ".txt" suffix is automatically appended.
 
The method creates an encoded file with the same base name and ".czp" * suffix. * * @param filename The file name of the file to be compressed. */ public void compress(String filename) /** * Uncompress the specified file from 'czp' to 'txt' format. The file must * exist, and it must be a czp-encoded file with suffix ".czp". The * filename may or may not include the suffix. If not, the ".czp" suffix * is automatically appended. The method creates an uncompressed file with * the same base name and ".txt" suffix. * * @param filename The file name of the file to be uncompressed. */ public void uncompress(String filename) /** * Show the content of the requested file in the text terminal. * The file must exist, and it must be a text file with suffix ".txt".
 
The filename may or may not include the suffix. If not, the ".txt" * suffix is automatically appended. * * @param filename The file name of the file to be displayed. */ public void showFile(String filename) /** * Decode and show the content of the requested file in the text terminal. * The file must exist, and it must be a text file with suffix ".zap". * The filename may or may not include the suffix. If not, the ".zap" * suffix is automatically appended. The file is decoded and displayed.
 
param filename The file name of the file to be displayed. */ public void decodeAndShowFile(String filename) An implementation for the methods in the FileHandler class is given below. You need to provide proper comments for this class. import java.util.*; import java.io.*; /** * * */ public class FileHandler { /** * * */ public FileHandler() { } /** * * */ public List readFile(String filename) { List chars = new ArrayList(); try { FileReader inFile = new FileReader(filename); int ch = inFile.read(); while(ch != -1) { chars.add(new Character((char)ch)); ch = inFile.read(); } inFile.close(); } catch(IOException e) { System.out.println("Error reading file: " + filename); } return chars; } /** * * */ public void writeFile(String filename, List chars) { try { FileWriter outFile = new FileWriter(filename); for (Iterator it = chars.iterator(); it.hasNext(); ) { char ch = ((Character)it.next()).charValue(); outFile.write(ch); } outFile.close(); } catch(IOException e) { System.out.println("Error writing file: " + filename); } } } MARKING SCHEDULE q UML class diagram and explanation / 10 q UML sequence diagram(s) and explanation / 10.
Marking for diagrams will consist of
 
 
• Completeness of diagrams and descriptions
• Correct use of symbols
• Clarity of the design
• Logical split of functionality over the different classes q Implementation of classes / 40 Marking for classes will check that
• Each class has the appropriate responsibilities, no more, no less (class cohesion)
• Comments for classes, instance variables, and methods provide value-add
• Each instance variable and method has the correct access level
• Methods have the appropriate responsibility, no more, no less (method cohesion)
• Methods have the correct parameters
• Implementation of the class methods is correct and clear q Demonstrating high level of understanding during lab sessions. / 20 Marking for this outcome will be based on:
• Ability to explain the choices that were made in the diagrams and the reasons why
• Ability to explain choices that were made in the implementation
• Ability to explain the application
• Ability to answer related questions q Assuring quality of code. / 20 Marking for this outcome will be based on:
• Professional code management and version management
• Timely discussions, proofs of concept, and applicable tests
• Complete and concise interface to implemented features.
Answer:
UML Class DiagramUML Sequence Diagram
Bibliography

Bergmayr, A., Grossniklaus, M., Wimmer, M., & Kappel, G. (2014, September). Jump—from java annotations to uml profiles. In International Conference on Model Driven Engineering Languages and Systems (pp. 552-568). Springer, Cham.

Cite This Work

To export a reference to this article please select a referencing stye below:

My Assignment Help. (2020). I Am Currently Pursuing The ITPR6500 Bachelor Of Computing Systems, Focusing On Essay. (70 Characters). Retrieved from https://myassignmenthelp.com/free-samples/itpr6500-bachelor-of-computing-systems.

"I Am Currently Pursuing The ITPR6500 Bachelor Of Computing Systems, Focusing On Essay. (70 Characters)." My Assignment Help, 2020, https://myassignmenthelp.com/free-samples/itpr6500-bachelor-of-computing-systems.

My Assignment Help (2020) I Am Currently Pursuing The ITPR6500 Bachelor Of Computing Systems, Focusing On Essay. (70 Characters) [Online]. Available from: https://myassignmenthelp.com/free-samples/itpr6500-bachelor-of-computing-systems
[Accessed 23 December 2024].

My Assignment Help. 'I Am Currently Pursuing The ITPR6500 Bachelor Of Computing Systems, Focusing On Essay. (70 Characters)' (My Assignment Help, 2020) <https://myassignmenthelp.com/free-samples/itpr6500-bachelor-of-computing-systems> accessed 23 December 2024.

My Assignment Help. I Am Currently Pursuing The ITPR6500 Bachelor Of Computing Systems, Focusing On Essay. (70 Characters) [Internet]. My Assignment Help. 2020 [cited 23 December 2024]. Available from: https://myassignmenthelp.com/free-samples/itpr6500-bachelor-of-computing-systems.

Get instant help from 5000+ experts for
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing: Proofread your work by experts and improve grade at Lowest cost

loader
250 words
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Plagiarism checker
Verify originality of an essay
essay
Generate unique essays in a jiffy
Plagiarism checker
Cite sources with ease
support
close