Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] Cmsc 430 project 2

The second project involves modifying the syntactic analyzer for the attached compiler by adding to the existing grammar. The full grammar of the language is shown below. The highlighted portions of the grammar show what you must either modify or add to the existing grammar. function: function_header {variable} body function_header: FUNCTION IDENTIFIER [parameters] RETURNS type ; variable: IDENTIFIER : type IS statement parameters: parameter {, parameter} parameter: IDENTIFIER : type type: INTEGER | REAL | BOOLEAN body: BEGIN statement END ; statement: expression ; | REDUCE operator {statement} ENDREDUCE ; | IF expression THEN statement ELSE statement ENDIF ; | CASE expression IS {case} OTHERS ARROW statement ENDCASE ; operator: ADDOP | MULOP case: WHEN INT_LITERAL ARROW statement expression: ( expression ) | expression binary_operator expression | NOTOP expression | INT_LITERAL | REAL_LITERAL | BOOL_LITERAL | IDENTIFIER binary_operator: ADDOP | MULOP | REMOP | EXPOP | RELOP | ANDOP | OROP In the above grammar, the red symbols are nonterminals, the blue symbols are terminals and the black punctuation are EBNF metasymbols. The braces denote repetition 0 or more times and the brackets denote optional. Your parser should be able to correctly parse any syntactically correct program without any problem. You must modify the syntactic analyzer to detect and recover from additional syntax errors using the semicolon as the synchronization token. To accomplish detecting additional errors an error production must be added to the function header, another to the variable declaration and a final one to the when clause of the case statement. Your bison input file should not produce any shift/reduce or reduce/reduce errors. Eliminating them can be difficult so the best strategy is not introduce any. That is best achieved by making small incremental additions to the grammar and ensuring that no addition introduces any such errors. An example of compilation listing output containing syntax errors is shown below: 1 — Multiple errors 2 3 function main a integer returns real; Syntax Error, Unexpected INTEGER, expecting ‘:’ 4 b: integer is * 2; Syntax Error, Unexpected MULOP 5 c: real is 6.0; 6 begin 7 if a > c then 8 b 3.0; Syntax Error, Unexpected REAL_LITERAL, expecting ‘;’ 9 else 10 b = 4.; 11 endif; 12 ; Syntax Error, Unexpected ‘;’, expecting ENDLexical Errors 0 Syntax Errors 4 Semantic Errors 0 You are to submit two files. • The first is a .zip file that contains all the source code for the project. The .zip file should contain the flex input file, which should be a .l file, the bison file, which should be a .y file, all .cc and .h files and a makefile that builds the project. • The second is a Word document (PDF or RTF is also acceptable) that contains the documentation for the project, which should include the following: a. A discussion of how you approached the project b. A test plan that includes test cases that you have created indicating what aspects of the program each one is testing and a screen shot of your compiler run on that test case c. A discussion of lessons learned from the project and any improvements that could be made Grading Rubric Criteria Meets Does Not Meet Functionality 70 points 0 pointsParses all syntactically correct programs (25) Does not parse all syntactically correct programs (0) Productions correctly implement precedence and associativity (10) Productions do not correctly implement precedence and associativity (0) Grammar contains no shift/reduce or reduce/reduce errors (5) Grammar contains shift/reduce or reduce/reduce errors (0) Detects and recovers from all programs with single syntax errors (20) Does not detect and recover from errors in the function header (0) Detects and recovers from a program with multiple syntax errors (10) Does not detect and recover from multiple errors (0) Test Cases 15 points 0 pointsIncludes test cases that test all grammar productions (6) Does not include test cases that test all grammar productions (0) Includes test cases that test errors in all productions (6) Does not include test cases that test errors in all productions (0) Includes test case with multiple errors (3) Does not include test case with multiple errors (0) Documentation 15 points 0 pointsDiscussion of approach included (5) Discussion of approach not included (0) Lessons learned included (5) Lessons learned not included (0)

$25.00 View

[SOLVED] Cmsc 430 project 1

The first project involves modifying the attached lexical analyzer and the compilation listing generator code. You need to make the following modifications to the lexical analyzer, scanner.l: 1. A new token ARROW should be added for the two character punctuation symbol =>. 2. The following reserved words should be added: case, else, endcase, endif, if, others, real, then, whenEach reserved words should be a separate token. The token name should be the same as the lexeme, but in all upper case. 3. Two additional logical operators should be added. The lexeme for the first should be or and its token should be OROP. The second logical operator added should be not and its token should be NOTOP. 4. Five relational operators should be added. They are =, /=, >, >= and 6 and 8 = 5 * (7 – 4); 6 end;Compiled Successfully Here is the required output for a program that contains more than one lexical error on the same line: 1 — Function with two lexical errors 2 3 function test2 returns integer; 4 begin 5 7 $ 2 ^ (2 + 4); Lexical Error, Invalid Character $ Lexical Error, Invalid Character ^ 6 end;Lexical Errors 2 Syntax Errors 0 Semantic Errors 0 You are to submit two files. 1. The first is a .zip file that contains all the source code for the project. The .zip file should contain the flex input file, which should be a .l file, all .cc and .h files and a makefile that builds the project. 2. The second is a Word document (PDF or RTF is also acceptable) that contains the documentation for the project, which should include the following: a. A discussion of how you approached the project b. A test plan that includes test cases that you have created indicating what aspects of the program each one is testing and a screen shot of your compiler run on that test case c. A discussion of lessons learned from the project and any improvements that could be made Grading Rubric Criteria Meets Does Not Meet Functionality 70 points 0 pointsDefines new comment lexeme (5) Does not define new comment lexeme (0) Correctly modifies identifier definition to include underscores (5) Does not correctly modify identifier definition to include underscores (0) Adds real and Boolean tokens (5) Does not add real and Boolean tokens (0) Defines additional logical operators (5) Does not define additional logical operators (0) Defines additional relational operators (5) Does not define additional relational operators (0) Defines additional arithmetic operators (5) Does not define additional arithmetic operators (0) Defines additional reserved words and arrow symbol(5) Does not define additional reserved words and arrow symbol (0) Adds new tokens to the token header file (5) Does not add new tokens to the token header file (0) Implements modifications to display multiple errors on the same line (15) Does not implement modifications to display multiple errors on the same line (0) Implements modifications to count and display each type of compilation error (15) Does not Implement modifications to count and display each type of compilation error (0) Test Cases 15 points 0 pointsIncludes test case containing all lexemes (5) Does not include test case containing all lexemes (0) Includes test case with multiple errors on one line (5) Does not include test case with multiple errors on one line (0) Includes test case with no errors (5) Does not include test case with no errors (0) Documentation 15 points 0 pointsDiscussion of approach included (5) Discussion of approach not included (0) Lessons learned included (5) Lessons learned not included (0)

$25.00 View

[SOLVED] Cmsc412 – file/directory processing

Write a Java, C# or C/C++ program (the choice is yours) for file/directory processing according to the following rules. The program requested for this project must have a text menu like this:0 – Exit 1 – Select directory 2 – List directory content (first level) 3 – List directory content (all levels) 4 – Delete file 5 – Display file (hexadecimal view) 6 – Encrypt file (XOR with password) 7 – Decrypt file (XOR with password) Select option:The menu is displayed and the user must select an option (a number between 0 and 7). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program.The options are:0 – Exit This options ends the program1 – Select directory The user is prompted for a directory [absolute] name. This is the first options that must be selected by the user. All the options below are working on the directory selected here. After performing several operations on the selected directory, the user can select another directory and work with it.2 – List directory content (first level) This option displays the content of the selected directory on the screen. All the files and subdirectories from the first level must be displayed (files and directories should be listed separately). If no directory was selected an error message must be displayed.3 – List directory content (all levels) This option displays the content of the selected directory on the screen. All the files and subdirectories from the first and subsequent levels must be displayed (files and directories should be listed separately). If no directory was selected an error message must be displayed.4 – Delete file This option prompts the user for a filename and deletes that file from the selected directory. If no directory was selected an error message must be displayed. If the directory does not contain the file specified by the user, an error message must be displayed. The filename does not include any path, it’s just the name of the file.5 – Display file (hexadecimal view) This option prompts the user for a filename (from the selected directory) and displays the content of that file on the screen, in hexadecimal view. If no directory was selected an error message must be displayed. If the directory does not contain the file specified by the user, an error message must be displayed. The filename does not include any path, it’s just the name of the file. Note 1: The hexadecimal view displays each byte of the file in hexadecimal; it should look something like this, but simpler:Note2: The ASCII representation, the Current Offset and the Value Preview are NOT required; also there is no window, no graphics, no colors, just black and white text display. Being a text only display, you are required to display ONLY the Data Offset and the Hexadecimal Representation.6 – Encrypt file (XOR with password) passwordpasswordpasswordpasswordpasswordpasswordpass this is the file content that we need to encrypt nowchiphertext is obtained here by XORing byte to byteNote1: the user must be prompted for the filename of the encrypted file (containing the ciphertext) as well, otherwise we would need to overwrite the initial file. Note2: If no directory was selected an error message must be displayed. If the directory does not contain either of the files specified by the user, an error message must be displayed. The filenames do not include any path.7 – Decrypt file (XOR with password) passwordpasswordpasswordpasswordpasswordpasswordpass chiphertext is here …this is the file content that we had initiallyNote1: the user must be prompted for the filename of the decrypted file as well, otherwise we would need to overwrite the initial file. Note3: If no directory was selected an error message must be displayed. If the directory does not contain either of the files specified by the user, an error message must be displayed. The filenames do not include any path.Testing: 1. You should use this file as the test file for Display, Encryption and Decryption. 2. For encryption, use the following password “Qwertyuiop[123$4$567]” 3. After encrypting this file with the above password, you obtain an encrypted file of the same length; after decrypting that file with the same password you should obtain an exact replica of this file, and this must be reflected in the Report document by appropriate screenshots showing the content of the files involved in these operations.Deliverables: 1. Source code (zipped) 2. A Report showing the program performing each of the 7 actions correctly (use screenshots), plus screenshots showing the error reporting situations.

$25.00 View

[SOLVED] Cmsc412 –

Demand paging problems (page replacement algorithms):1. For the following reference string apply the FIFO page replacement algorithm.– Option 1 – according to Week 6 – Textbook Readings: Reference string 2 4 5 6 1 5 3 4 5 2 3 6 5 3 4 7 3 5 6 Physical frame 0 2 2 2 2 Physical frame 1 4 4 4 Physical frame 2 5 5 Physical frame 3 6 Page faults F F F F Victim frames OR – Option 2 – according to Week 6 – Module Readings Reference string 2 4 5 6 1 5 3 4 5 2 3 6 5 3 4 7 3 5 6 Physical frame 0 2 4 5 6 Physical frame 1 2 4 5 Physical frame 2 2 4 Physical frame 3 2 Page faults F F F F Victim frames2. For the following reference string apply the OPT page replacement algorithm. Reference string 2 4 5 6 1 5 3 4 5 2 3 6 5 3 4 7 3 5 6 Physical frame 0 2 2 2 2 Physical frame 1 4 4 4 Physical frame 2 5 5 Physical frame 3 6 Page faults F F F F Victim frames3. For the following reference string apply the LRU page replacement algorithm. Reference string 2 4 5 6 1 5 3 4 5 2 3 6 5 3 4 7 3 5 6 Physical frame 0 2 2 2 2 Physical frame 1 4 4 4 Physical frame 2 5 5 Physical frame 3 6 Page faults F F F F Victim frames4. For the following reference string apply the LFU page replacement algorithm. Reference string 2 4 5 6 1 5 3 4 5 2 3 6 5 3 4 7 3 5 6 Physical frame 0 2 2 2 2 Physical frame 1 4 4 4 Physical frame 2 5 5 Physical frame 3 6 Page faults F F F F Victim frames

$25.00 View

[SOLVED] Cmsc 412 homework 2

Write a C program for UNIX that creates three processes, a grandparent (G), a parent (P) and a child (C). The first process is the grandparent G, which creates the process P (the parent) and then waits until P finishes its execution. Process P in turn, will create the child process C and waits until C finishes its execution. More precisely, the following list describes the behavior of each process: 1. Process G will create process P, will wait for process P to finish its execution, and then will display its own pid. 2. Process P will create process C, will wait for process C to finish its execution, and then will display its own pid and the pid of process G (its parent). 3. Process C will display its own pid, the pid of process P (its parent) and the pid of process G (its grandparent) When run, the program will display the following (where X, Y, Z are numbers representing process ids): I am the child process C and my pid is X. My parent P has pid Y. My grandparent G has pid Z. I am the parent process P and my pid is Y. My parent G has pid Z. I am the grandparent process G and my pid is Z.

$25.00 View

[SOLVED] Cmsc412 – final project cmsc – operating systems

Design and implement a Demand Paging virtual memory simulator! It must be a text based application (NOT a GUI based one). You can use the C/C++ or Java programming language. The following algorithms must be implemented: FIFO, OPT, LRU and LFU. The application must simulate the execution of each of these algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1, N

$25.00 View

[SOLVED] Cmsc204 – thread lab cs204 myers

Start with the Car, CarPanel and CarFrame provided.Add a CarQueue class that maintains a queue of random directions that the car should go. 1. There is an addToQueue method that has a class that implements runnable, define the run method (add random directions into the queue and then sleep), creates an instance of the runnable object, creates a thread and starts the thread. /** Adds 0,1,2 or 3 to queue * 0 = up * 1 = down * 2 = right * 3 = left */2. It also has a deleteQueue method that returns an Integer;3. In your constructor, place 5 or 6 numbers in the queue so that when the animation starts – there will be something to retrieve from the queueModify the run method of the startAnimation in CarPanel so that the car will go to the right, left, up or down depending on what is retrieved from the CarQueue. The cars should go in the opposite direction if they hit a boundary.

$25.00 View

[SOLVED] Cmsc 204 recursion lab

Write a recursive method to sum the values in an array of integers. Create a file ArraySum.java and add the recursive method public int sumOfArray (Integer[] a,int index). Note that ‘a’ is an array of type Integer that is specified in the driver file, and ‘index’ is an integer that shows which number in the array to sum next. Use the driver class ArraySumDriver.java to populate your array and demonstrate that your method works. Load the files ArraySum.java and ArraySumDriver.java to GitHub and take a screen shot. Upload your ArraySum.java, ArraySumDriver.java and your GitHub screen shot to Blackboard.

$25.00 View

[SOLVED] Cmsc204

Generic Lab Start with the DataSet class and make it into a generic DataSetGen class. This class should load any instance of a class that implements Measurable, and no classes that do not implement Measurable. Test it with the DataSetTester. The DataSetTester uses the BankAccount and BaseballPlayer classes. Do not change any of the classes except DataSet. Upload the original DataSet.java, DataSetTester.java, BankAccount.java, BaseballPlayer.java, and Measurable.java in a directory named GenericLab, into your repository in GitHub from Lab 1. Upload DataSetGen.java into the same directory.

$25.00 View

[SOLVED] Cmsc204 – lab 4 – networking chat room

Lab Objectives • Be able to create server and client sockets • Be able to create input and output streams to and from sockets • Be able to create threads • Be able to run an object in a threadIntroduction Everyone is familiar with chat rooms. In this lab we are going to create a server/client infrastructure that supports multiple users sending messages to each other. In this lab you will not need to build the user interface, or to design the class structure. You will be given most of the class structure and will focus on creating instances of classes that run inside threads, and on creating sockets and in- and out-streams with which to communicate. First, we need a blueprint. Here is the basic class diagram:Let’s look more closely at each class. 1. GUI. The user interface is a set of classes providing the basic interface to start a server, start each client, and exit the application. You will not need to edit this code. 2. ChatServerExec. The sole responsibility of the ChatServerExec is to implement the method startServer. This class implements the ChatServerExecInterface. You will be editing this class to put the server in a thread and start the thread. The ChatServer is placed in its own thread so the GUI can operate asynchronously. The ChatServerExec then exits, while the ChatServer continues to operate. 3. ChatServer. The responsibility of this class is to create the server socket, listen for each client, and set up in- and out-streams. It then ensures that each client submits a unique screen name and adds the name to the set of client names. Finally, it creates a server to respond to the individual client and places it in a thread. The ChatServer than continues its loop to listen for the next client. 4. ServerThreadForClient. This server responds to an individual client. When its client sends it a message, this server is responsible for sending out that message to each outstream, i.e., to each client. Note that this is an inner class. 5. ChatClientExec. Just like the ChatServerExec, this class is responsible for implementing startClient, which involves running the ChatClient instance in a thread. This class implements the ChatClientExecInterface. 6. ChatClient. This class is responsible for building its own window (code provided) as a separate GUI. You will create a client socket with server address and port and set up in- and out-streams to the server. The class then follows the application protocol. This involves first getting a screen name from the user, and then receiving messages from the clients via the ServerThreadForClient instances and posting the message in its textarea. When this client sends a message, the user enters it into the window’s textfield whereupon it is sent to its ServerThreadForClient. ChatClient implements ChatClientInterface. 7. Upload the initial files in GitHub in the repository you created in Lab 1, and modify them as you implement the solution. Take a screen shot of the repository and submit it.Task #1 Starting a Thread 1. In ChatServerExec, create a thread containing the server instance, and start the thread. 2. In ChatServer, create a server socket. Also uncomment the System.out.println so that the console reflects that a server was started. 3. When you run the GUI, you will be able to start the server, and launch clients, but will not be able to enter anything in the client’s textfield. Task #2 Creating In- and Out-Streams 1. Inside the ChatServer while loop, listen for a client to join, and when one does, create an in- and an out-stream. 2. Compile and run, but you will still not be able to enter messages. Task #3 Creating the Client 1. In ChatClientExec, create a thread containing the client instance, and start the thread. 2. In ChatClient’s run method, create a client socket with server address and server port. 3. In ChatClient’s run method, set up in- and out-streams. Task #4 Running the application 1. Compile and run. 2. Start the server first. 3. Then start a client. Enter a screen name. 4. Start a second client, with a unique screen name. 5. Send messages by entering in a client’s textfield. 6. Take a screen shot of two clients running and chatting.

$25.00 View

[SOLVED] Cmsc204 –

In this project you will be creating an application to maintain a network of towns and the roads connecting them. The application will use Dijkstra’s Shortest Path algorithm to find the shortest distance between any two towns. Upload the initial files and your working files to the repository in GitHub you created in Lab 1, in a directory named Assignment6.Implement Graph Interface Use Graph to maintain a network of Vertices Implement Shortest Path AlgorithmData Element – Town (Vertex) Create a Town class that holds the name of the town and a list of adjacent towns, and other fields as desired, and the traditional methods (constructors, getters/setters, toString, etc.). It will implement the Comparable interface. This is the class header: public class Town implements Comparable Two towns will be considered the same if their name is the same. Data Element – Road (Edge) Create a class Road that can represent the edges of a Graph of Towns. The class must implement Comparable. The class stores references to the two vertices(Town endpoints), the distance between vertices, and a name, and the traditional methods (constructors, getters/setters, toString, etc.), and a compareTo, which compares two Road objects. Since this is a undirected graph, an edge from A to B is equal to an edge from B to A. This is the class header: public class Road implements ComparableData Structure – Graph, implements GraphInterface Create a Graph class that implements the GraphInterface given you. For Graph, V is the vertex type (a Town), E is the edge type (a Road). You will need to decide how to store the graph, use an adjacent matrix or an adjacency list. This is the class header: public class Graph implements GraphInterface Within the Graph interface is a method shortestPath, which finds the shortest path from a given source Town to a destination Town. Since there is a unique shortest path from every vertex to the source, there is a back-pointer to the previous vertex. The method shortestPath calls dijkstraShortestPath which finds the shortest path from the source to every other vertex in the graph. You will be coding the Dijkstra’s Shortest Path algorithm. You will then be able to find the connections between two towns through the roads that connect them. weighted graph which means that the edges have a weight, and this is used to determine the shortest path. For this implementation, each weight will be the distance of the road in miles. Data Manager – implements TownGraphManagerInterface Your TownGraphManager will hold an object of your Graph. Implement the TownGraphManagerInterface. There are methods to populate the graph (reading from a text file), add a town (vertices), add a road (edge), list all towns and all roads, and list towns adjacent to a given town. Your solution will find the shortest path from a start town to a destination town. It will account for the possibility of a disjoint graph (i.e., not all vertices can be reached from all other vertices.)Exception Classes FileNotFoundException – created and thrown when the selected input file is not found. IOException – created and thrown when user selects an input file that cannot be read (check out the methods of File). Note that these exceptions exist in the Java API. GUI Driver (provided for you) The GUI has four sections: a Town section where you can add towns, a Road section where you add roads, a Find Connection section, and an administration section. It has a Read File button, which allows the text files provided to be read and populate the graph.Testing 1. Your completed implementation must pass the TownGraphManagerTest.java and the GraphTest.java. 2. The tests marked GFA (“Good Faith Attempt”) are the minimal testing that must pass in order for your implementation to meet the good faith attempt. 3. Create a JUnit Test – TownGraphManager_STUDENT_Test. Test all the methods of the TownGraphManager with a different set of data than the TownGraphManagerTest provided for you. 4. Create a JUnit Test – Graph_STUDENT_Test. Test all the methods of the Graph with a different set of data than the GraphTest provided for you. 5. Create a Junit Test – Road_STUDENT_Test. Test all the methods of your Road class. 6. Create a Junit test – Town_STUDENT_Test. Test all the methods of your Town class.Populating the Data Structure You will be reading from a data file. You are provided with two sample files: MD Towns.txt and US Towns.txt along with two PowerPoint slides showing these graphs.The Towns.txt files hold the information for the individual Towns and Roads, and is in the following format: road-name,miles;town-name; town-name For example: I-94,282;Chicago;Detroit Notice that the road-name and miles are separated by a comma, while the road information and the two towns are separated by semi-colons.After reading these files, you will have an initial set of vertices and edges in your Graph.The GUI (Provided for you) The GUI will have four sections: an Add Town section, an Add Road section, a Find Connection section, and an administration section. There will be four ComboBoxes each containing the same list of Towns. On startup the graph will be empty.Add a Town Button Add a Road Button To add a road, a town must be selected from each of the two ComboBoxes in the Add Road section, an integer distance entered, and a road name entered. When the Add Road button is selected, the edge is created and entered in the graph.Find Connection Button Display all the available towns in the ComboBoxes (in alpha order by name). When the user selects the towns, display the name in the ComboBoxes. When the user selects the “Find Connection” button, the TownGraphManager’s shortestPath method is called. The resulting list of roads connecting towns, and the distance along each road, is displayed in the text area.If the “source” town and “destination” town are the same, or if there is no route between the two, state that in the text area. Read File Button The Towns.txt files hold information for individual Towns and Roads, and is in the following format: road-name,miles;town-name;town-name For example: I-94,282;Chicago;Detroit Notice that the road-name and miles are separated by a comma, while the road information and the two towns are separated by semi-colons.Exit Button The program will terminate.Deliverables / Submissions: Design: UML class diagram with algorithm (pseudo-code) for methods Implementation: Submit a compressed file containing the follow (see below): The Java application (it must compile and run correctly); Javadoc files in a directory; a write-up as specified below. Be sure to review the provided project rubric to understand project expectations. The write-up will include: • UML diagram • In three or more paragraphs, highlights of your learning experienceDeliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats: • LastNameFirstName_Assignment4_Complete.zip, a compressed file in the zip format, with the following: o Write up (Word document) – reflection paragraphs o Final Design: UML Diagram – latest version (Word or jpg document) o Screen shot of GitHub repository with final set of files. o doc (directory) – Javadoc • File1.html (example) • File2.html (example) o src (directory) • File1.java (example) • File2.java (example)• LastNameFirstName_Assignment4_Moss.zip, a compressed file containing one or more Java files: o File1.java (example) o File2.java (example) This folder should contain Java source files only

$25.00 View

[SOLVED] Cmsc204 –

Assignment DescriptionWrite the classes required to create a Morse Code Converter Utility. Your Morse Code Converter Utility will be using a generic linked binary tree with generic TreeNodes to convert Morse Code into English. There is no GUI requirement for this assignment. You are supplied a GUI for testing purposes.Concepts tested by this assignmentGeneric Classes Utility Class (all static methods) Linked Trees Building a Tree for conversion purposesData Element – TreeNode classData Structure – MorseCodeTree class A generic linked binary tree which inherits from the LinkedConverterTreeInterface. Utility class – MorseCodeConverter The MorseCodeConverter contains a static MorseCodeTree object and constructs (calls the constructor for) the MorseCodeTree. This class has two static methods convertToEnglish to convert from morse code to English. One method is passed a string object (“.-.. — …- . / .-.. — — -.- …”). The other method is passed a file to be converted. These static methods use the MorseCodeTree to convert from morse code to English characters. Each method returns a string object of English characters. There is also a static printTree method that is used for testing purposes – to make sure the tree for MorseCodeTree was built properly. Use the Javadoc provided to make sure that your MorseCodeConverter class follows the method headers so that the MorseCodeConverterTest will run correctly. Testing – JUnit Test Classes You must add at least 1 test for MorseCodeConverter.convertToEnglish(String) and at least 1 test for MorseCodeConverter.convertToEnglish(File) to the MorseCodeConverterTest class. You must create a JUnit test for your MorseCodeTree class. Include your test files with your code files.Assi gnment DetailsThis is a table for the conversion from Morse Code to alpha letters.Building the MorseCodeTree (method buildTree) Your MorseCodeTree is a 4 levels tree. Insert a mapping for every letter of the alphabet into the tree map. The root is a TreeNode with an empty string. The left node at level 1 stores letter ‘e’ (code ‘.’) and the right node stores letter ‘t’ (code ‘-‘). The 4 nodes at level 2 are ‘i’, ‘a’, ‘n’, ‘m’ (code ‘..’, ‘.-‘, ‘-.’, ‘—‘). Insert into the tree by tree level from left to right. A ‘.’ will take the branch to the left and a ‘-‘ will take the branch to the right. This is the structure of the tree.Using the MorseCodeTree Use the MorseCodeTree to convert Morse Code to English by taking the code and finding it’s corresponding English letter by traversing the MorseCodeTree, ‘.’ branches to the left and ‘-‘ branches to the right. The code ‘.–.’ would branch to the left, then to the right, then to the right, then to the left to Fetch the letter ‘p’. Each letter is delimited by a space (‘ ‘). Each word is delimited by a ‘/’.Some suggestions: 1. There is a morse code translator at: http://morsecode.scphillips.com/jtranslator.htmlThis will help you build files and test cases for your JUnit Tests.Test Cases: Hello WorldHow do I love thee let me count the waysDeliverables / Submissions: Design: UML class diagram with algorithm (pseudo-code) for methods Implementation: Submit a compressed file containing the follow (see below): The Java application (it must compile and run correctly); Javadoc files in a directory; a write-up as specified below. Be sure to review the provided project rubric to understand project expectations. The write-up will include: • UML diagram • In three or more paragraphs, highlights of your learning experienceDeliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats: • LastNameFirstName_Assignment4_Complete.zip, a compressed file in the zip format, with the following: o Write up (Word document) – reflection paragraphs o UML Diagram – latest version (Word or jpg document) o doc (directory) – Javadoc • File1.html (example) • File2.html (example) o src (directory) • File1.java (example) • File2.java (example)• LastNameFirstName_Assignment4_Moss.zip, a compressed file containing one or more Java files: o File1.java (example) o File2.java (example) This folder should contain Java source files only

$25.00 View

[SOLVED] Cmsc204 –

Assignment DescriptionMost data is stored in databases, for ready access and organization. Our course data is backed up by IT in databases which makes our data easy to access and use.Write a program that creates a database of courses. It will either read from a file of courses, or allow the user to add one course at a time. Upload the initial files and your working files in the repository in GitHub you created in Lab 1, in a directory named Assignment4. Take a screenshot of your repo, and post the assignment to the Assignment 4 dropbox.Concepts tested by this assignmentHash Table, Link List, hash code, buckets/chaining, exception handling, read/write files using FileChooserData Element – CourseDBElement,Data Structure – CourseDBStructure Implements the CourseDBStructureInterface that is provided. You will be implementing a hash table with buckets. It will be an array of linked lists of CourseDBElements. Each CDE will have a hash code that comes from the CRN, since the CRN is unique for courses. Note that the CRN is an int, and the tests require the hashcode of a string, so you will need to coerce it to a String, and take the hash code of the resulting string. The add method will take a CourseDBElement and add it to the data structure. If a linked list at the relevant hash code doesn’t exist, create a LinkedList with the first element being the CDE and add it to the HashTable. If the LinkedList already exists, add the CDE to the existing list. Two constructors for the CDS will be required, one that takes in an integer that is the estimated number of courses, the other is used for testing purposes. The comments in the CourseDBStructureInterface (provided) should help you figure out how to set the length of the hash table. You will not need to use the 4k+3 code.Data Manager – CourseDBManager Implements the CourseDBManagerInterface that is provided. The data manager allows the user to read the courses from a file or to enter the data by hand, and uses an Alert to print out the database elements. The input is read from a file or read from the textfields and is added to the data structure through the add method. The add method uses the CDS add method. The CourseDBManager is also referred to as a CDM.Exception Classes IOException – created and thrown when user selects an input file that cannot be read or attempting to retrieve a CDE that does not exist in the DB.GUI Driver (provided) • User will only create a course database once they have entered an input file or entered one or more sets of attributes. • Buttons and textfields are grayed out if they are not relevant at the current time. • A FileChooser is used to select the input and output files. • Inform the user if there is an error with the input file. • Use exception handling for the validity of the files. • A way is provided for the user to “clear” the text fields. • A way is provided for the user to select a CRN and retrieve the corresponding course.Testing Create a JUnit Test – CourseDBManager_STUDENT_Test.Assi gnment DetailsThere will be two ways to create a course database. The first requires a document to be read from an input file. The second reads the input from five textfields. Once there is data in the database, the GetCourse button will be enabled to allow you to see the data. See the example below.Select the input file button and navigate to the file.Use ShowDB button to display the CDEs that were read:Example of Creating a CDE from text fields. First select the other radio button, then fill in the textfields, then select the “Add to DB” button.Select the Show DB button to see the resulting CDEs.Example of retrieving a CDE. First select the GetCourse button. Three components at the bottom of the screen will become enabled. Then fill in the CRN and select the FindCourse button to find the applicable course from the database.The general design is shown here to guide you in formulating your own design:Deliverables / Submissions: Design: UML class diagram with algorithm (pseudo-code) for methods Implementation: Submit a compressed file containing the follow (see below): The Java application (it must compile and run correctly); Javadoc files in a directory; a write-up as specified below. Be sure to review the provided project rubric to understand project expectations. The write-up will include: • UML diagram • In three or more paragraphs, highlights of your learning experienceDeliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats: • LastNameFirstName_Assignment4_Complete.zip, a compressed file in the zip format, with the following: o Write up (Word document) – reflection paragraphs o GitHub repository with java files from Assignment 4. o Final Design: UML Diagram – latest version (Word or image) o doc (directory) – Javadoc • subdirectories (as is) • File1.html (example) • File2.html (example) o src (directory) • File1.java (example) • File2.java (example)• LastNameFirstName_Assignment4_Moss.zip, a compressed file containing one or more Java files: o File1.java (example) o File2.java (example) This folder should contain Java source files only

$25.00 View

[SOLVED] Cmsc204 –

Assignment DescriptionYour assignment is to write a generic double singly-linked list class with an iterator, and a generic sorted double singly-linked list class with an iterator that inherits from your generic double singly-linked list class. The GUI has been provided for you for this assignment to help you visualize your linked list. Your list classes will also be tested with Junit tests. Upload the initial files from Blackboard and your working files in a directory into the repository in GitHub you created in Lab 1 and take a screen shot of the files.Concepts tested by this assignmentException handling Generic Classes Double Linked List Ordered Double Linked List Iterators ComparatorsClassesBasicDoubleLinkedListThis generic double singly-linked list relies on a head (reference to first element of the list) and tail (reference to the last element of the list) where the last node points to the first element of the list. Both the head and the tail are set to null when the list is empty. Both point to the same element when there is only one element in the list, and now the element’s “next” reference points to itself. A node structure has only two fields: data and the next references. The class must only define the following entities: an inner class Node, an inner class that implements ListIterator (for the iterator method), head and tail references and an integer representing the list size. However only the next(), hasNext(), previous() and hasPrevious() methods of the ListIterator are you required to implement. The rest of the methods can throw the UnsupportedOperationException, such as: public void remove() throws UnsupportedOperationException{ throw new UnsupportedOperationException();} All the entities are defined as protected so they can be accessed by the subclass. Follow the Javadoc that is provided.SortedDoubleLinkedList A generic sorted double linked list will be constructed using a provided Comparator to determine how the list is to be sorted. It extends BasicDoubleLinkedList class. The addToFront and the addToEnd methods will not be supported and an add method will be added that inserts to the double linked list in sorted order dependent on the Comparator. Follow the Javadoc that is provided.Exception Handling • UnsupportedOperationException – this exception is a Java library exception and will be returned by the addtoFront and addToEnd implementations of the SortedDoubleLinkedList class and by the remove method of the iterator. • NoSuchElementException – this exception is a Java library exception and will be returned by the next function within the iterator class when there are no more elements in the linked list.GUI driver (provided for you) A GUI driver has been provided for you to help you visualize your doubly-linked lists. Here is the minimum that must be in place to start using the GUI driver effectively. • All methods in your BasicDoubleLinkedList and SortedDoubleLinkedList must be stubbed. • The addToFront or addToEnd method of the BasicDoubleLinkedList must be implemented to create a basic double singly-linked list. • The add method of the SortedDoubleLinkedList must be implemented to create a sorted double singlylinked list. • The toArrayList method in both the BasicDoubleLinkedList and SortedDoubleLinkedList, which returns an arraylist of the items in the list from the head of list to the tail of list. This method is used to display the contents of the lists.Testing 1. Your code should cause the BasicDoubleLinkedList_Test tests to succeed. 2. Your code should cause the SortedDoubleLinkedList_Test tests to succeed. 3. Create a JUnit Test – BasicDoubleLinkedList_STUDENT_Test. 4. Create a JUnit Test – SortedDoubleLinkedList_STUDENT_Test.Adding to a Basic List Adding to a Sorted ListRemoving Second from basic Removing Thomas from sortedStart the iterators for Basic and Sorted. Think of iterators being “in between” nodes.Example of selecting “Next” for Basic and then for Sorted list. Think of iterators being “in between” nodes.Example of “Next” for basic and “Previous” for Sorted. Think of iterators being “in between” nodes.Deliverables / Submissions: Design: UML class diagram with algorithm (pseudo-code) for methods Implementation: Submit a compressed file containing the follow (see below): The Java application (it must compile and run correctly); Javadoc files in a directory; a write-up as specified below. Be sure to review the provided project rubric to understand project expectations. The write-up will include: • Final design: UML diagram with pseudo-code • In three or more paragraphs, highlights of your learning experienceDeliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats: • LastNameFirstName_Assignment3_Complete.zip, a compressed file in the zip format, with the following: o Write up (Word document) – reflection paragraphs o UML Diagram – latest version (Word or jpg document) o doc (directory) – Javadoc • File1.html (example) • File2.html (example) • Sub-directory (example) o src (directory) • File1.java (example) • File2.java (example)• LastNameFirstName_Assignment3_Moss.zip, a compressed file containing one or more Java files: o File1.java (example) o File2.java (example) This folder should contain Java source files only

$25.00 View

[SOLVED] Cmsc204 –

CMSC 204 Assignment #2 NotationInfix notation is the notation commonly used in arithmetical and logical formulae and statements. It is characterized by the placement of operators between operands – “infixed operators” – such as the plus sign in “2 + 2”. Postfix notation is a notation for writing arithmetic expressions in which the operands appear before their operators. There are no precedence rules to learn, and parentheses are never needed. You will be creating a utility class that converts an infix expression to a postfix expression, a postfix expression to an infix expression and evaluates a postfix expression.Concepts tested: Generic Queue Generic Stack Exception handlingData Element StringData Structures 1. Create a generic queue class called NotationQueue. NotationQueue will implement the QueueInterface given you. You will be creating NotationQueue from scratch (do not use an internal object of the Queue class from java.util) 2. Create a generic stack class called NotationStack. NotationStack will implement the Stack Interface given you. You will be creating NotationStack from scratch (do not use an internal object of the Stack class from java.util)Utility Class The Notation class will have a method infixToPostfix to convert infix notation to postfix notation that will take in a string and return a string, a method postfixToInfix to convert postfix notation to infix notation that will take in a string and return a string, and a method to evaluatePostfix to evaluate the postfix expression. It will take in a string and return a double. In the infixToPostfix method, you MUST use a queue for the internal structure that holds the postfix solution. Then use the toString method of the Queue to return the solution as a string. For simplicity sake: a. operands will be single digit numbers b. the following arithmetic operations will be allowed in an expression: + addition – subtraction * multiplication / division Exception Classes Provide the following exception classes: 1. InvalidNotationFormatException – occurs when a Notation format is incorrect 2. StackOverflowException – occurs when a top or pop method is called on an empty stack. 3. StackUnderflowException – occurs when a push method is called on a full stack. 4. QueueOverflowException – occurs when a dequeue method is called on an empty queue. 5. QueueUnderflowException – occurs when a enqueue method is called on a full queue.ALGORITHMSInfix expression to postfix expression:Read the infix expression from left to right and do the following:If the current character in the infix is a space, ignore it. If the current character in the infix is a digit, copy it to the postfix solution queue If the current character in the infix is a left parenthesis, push it onto the stack If the current character in the infix is an operator, 1. Pop operators (if there are any) at the top of the stack while they have equal or higher precedence than the current operator, and insert the popped operators in postfix solution queue 2. Push the current character in the infix onto the stack If the current character in the infix is a right parenthesis 1. Pop operators from the top of the stack and insert them in postfix solution queue until a left parenthesis is at the top of the stack, if no left parenthesisthrow an error 2. Pop (and discard) the left parenthesis from the stack When the infix expression has been read, Pop any remaining operators and insert them in postfix solution queue.Postfix expression to infix expression:Read the postfix expression from left to right and to the following:If the current character in the postfix is a space, ignore it. If the current character is an operand, push it on the stack If the current character is an operator, 1. Pop the top 2 values from the stack. If there are fewer than 2 values throw an error 2. Create a string with 1st value and then the operator and then the 2nd value. 3. Encapsulate the resulting string within parenthesis 4. Push the resulting string back to the stack When the postfix expression has been read: If there is only one value in the stack – it is the infix string, if more than one value, throw an errorEvaluating a postfix expressionRead the postfix expression from left to right and to the following:If the current character in the postfix expression is a space, ignore it. If the current character is an operand, push on the stack If the current character is an operator, 1. Pop the top 2 values from the stack. If there are fewer than 2 values throw an error 2. Perform the arithmetic calculation of the operator with the first popped value as the right operand and the second popped value as the left operand 3. Push the resulting value onto the stack When the postfix expression has been read: If there is only one value in the stack – it is the result of the postfix expression, if more than one value, throw an errorGrading Rubric – CMSC 204 Project #2Name _____________________________ .PROGRAMMING (100 pts) Compiles 40 pts _____ Accuracy Passes public JUnit tests 15 pts _____ Passes STUDENT JUnit tests 10 pts _____ Execution: runs without errors (either run-time or logic errors) 20 pts _____ Possible Sub-total 100 pts _____ REQUIREMENTS (Subtracts from Programming total) Documentation: Javadoc was not provided for all student generated classes – 5 pts _____ Documentation within source code was missing or incorrect – 5 pts _____ Description of what class does was missing Author’s Name, @author, was missing Methods not commented properly using Javadoc @param, @return JUnit STUDENT methods were not implemented -5 pts _____ Learning Experience (text document) -4 pts _____ In 3+ paragraphs, highlight your lessons learned and learning experience from working on this project. What have you learned? What did you struggle with? What would you do differently on your next project?Programming Style: Incorrect use of indentation, statements, structuresDesign: Classes do not have the functionality specified, i.e., -10 pts _____ 1. Data Structures classes • Generic Stack class • Generic Queue class – 16 pts_____ 2. Utility class – Notation • Does not follow provided Javadoc -15 pts_____ • Does not correctly handle exceptions Possible decrements: -60 pts _____ Possible total grade: 100 pts _____

$25.00 View

[SOLVED] Cmsc204

Assignment 1 PasswordsConcepts tested by this program: ArrayList static Read Files Javadoc JUnit Tests ExceptionsCreate an application that will check for valid passwords. The following rules must be followed to create a valid password.1. At least 6 characters long 2. 10 or more characters is a strong password, between 6 and 9 characters is a weak (but acceptable) password. 3. At least 1 numeric character 4. At least 1 uppercase alphabetic character 5. At least 1 lowercase alphabetic character 6. At least 1 special character 7. No more than 2 of the same character in a sequence Hello@123 – OK AAAbb@123 – not OK Aaabb@123 – OKSpecial Characters: Special characters are a selection of punctuation characters that are present on standard US keyboard and frequently used in passwords. Character Name Space! Exclamation Double quote ”Character Name # Number sign (hash) Dollar sign $% Percent Ampersand &’ Single quote Left parenthesis () Right parenthesis Asterisk *+ Plus Comma ,– Minus Full stop ./ Slash Colon :; Semicolon Less than ? Question mark At sign @[ Left bracket Backslash] Right bracket Caret ^_ Underscore Grave accent (backtick) `{ Left brace Vertical bar |} Right brace Tilde ~Operation: When the application begins, the user will be presented with a screen that states the above instructions for creating a password, two text entry boxes for typing in a password, and three buttons. If the user wants to check a single password, they will type in the password in both boxes and select the “Check Password” button. If the user wants to read in and check a list of passwords, they will select the “Check Passwords in File” button, be presented with a file explorer, and select the file to read from. Those passwords that failed the check will be displayed, with their error message. Specifications:The Data Element String The Data Structure ArrayList of Strings Utility Class 1. Create a PasswordCheckerUtility class based on the Javadoc given you. 2. The PasswordCheckerUtility class will have at least three public methods: • isValidPassword: This method will check the validity of one password and return true if the password is valid and throw one or more exceptions if invalid. • isWeakPassword: This method will che throw an exception. • getInvalidPasswords This method will check an ArrayList of passwords and return an ArrayList with the status of any invalid passwords (weak passwords are not considered invalid). The ArrayList of invalid passwords will be of the following format: • For each password requirement, you must have a static private method that validates the password for that requirement and throws an exception if invalid. 3. Create a separate exception classes for each exception listed in PasswordCheckerUtility Javadoc. Hints: • Always check for the length of the password first, since that is the easiest and fastest check. Once the password fails one rule, you do not need to check the rest of the rules. • To check for a special symbol, use the “regular expression” construct. Check the whole password, not just an individual character, using the following: Pattern pattern = Pattern.compile(“[a-zA-Z0-9]*”); Matcher matcher = pattern.matcher(str); return (!matcher.matches()); • You will need to import Pattern and Matcher. • Few helpful links on regular expression” • https://www.vogella.com/tutorials/JavaRegularExpressions/article.html • https://www.youtube.com/watch?v=rhzKDrUiJVk • https://www.youtube.com/watch?v=sCuOJ8uadOgThe GUI: The GUI has been provided, however you need to: • Ask the user to enter the password and to re-type the password. If the two are not the same, inform the user. • Use methods of PasswordCheckerUtility to check validity of one password when user clicks on “Check Password” button. • Use methods of PasswordCheckerUtility to check validity of a file of passwords when user clicks on “Check Passwords in File” button. • Use a FileChooser for the user to select the input file. • Use try/catch structure to catch exceptions thrown by PasswordCheckerUtility methodsExceptions Provide exception classes for the following: 1. Length of password is less than 6 characters (class LengthException) Message – The password must be at least 6 characters long 2. Password doesn’t contain an uppercase alpha character (class NoUpperAlphaException) Message – The password must contain at least one uppercase alphabetic character 3. Password doesn’t contain a lowercase alpha character (class NoLowerAlphaException) Message – The password must contain at least one lowercase alphabetic character 4. Password doesn’t contain a numeric character (class NoDigitException) Message – The password must contain at least one digit 5. Password doesn’t contain a special character (class NoSpecialCharacterException) Message – The password must contain at least one special character 6. Password contains more than 2 of the same character in sequence (class InvalidSequenceException) Message – The password cannot contain more than two of the same character in sequence. 7. Password contains 6 to 9 characters which are otherwise valid (class WeakPasswordException) Message – The password is OK but weak – it contains fewer than 10 characters. 8. For GUI – check if Password and re-typed Password are identical (class UnmatchedException) Message – The passwords do not match Throw this exception from the GUI, not the utility class.Note: If more than one error is present in a password, use the above order to throw exceptions. For example, if a password is “xxyyzzwwaa$”, it fails rules 2 and 4 above. Throw a NoUpperAlphaException, not a NoDigitException.Junit methods: • setup • teardown • for each password requirement method in the PasswordCheckerUtitily you must have a test case that passes and another one that fails • success and fail test cases for each public method in the PasswordCheckerUtitily • The file that you use for getInvalidPasswords method Junit test must contain at least one invalid and one valid of each password requirement case.This is a sample of Junit test cases that you must have:If you select the button which reads “Check Passwords in File”, you will be presented with a file chooser. You must navigate to where you stored the file “passwords.txt” and load it. The file will be in the following format (one password per line):Examples:1. No lowercase alphabetic characterDisplayed to user:2. No digitDisplayed to user:3. If the password is OK, but between 6 and 10 characters, you will see:If password has more than two of the same characters in a rowDisplayed to user:If password is validIf the passwords do not match:Displayed to user:6. Based on the file above, when the user selects “Check Passwords in File”:Displays errors to user when selecting Check Passwords in File. Note that valid passwords (including weak but otherwise valid passwords) are NOT displayed.Deliverables:Design: Initial design document (UML and/or pseudo-code)Implementation: Final design document Java files – The src folder with your driver (javafx application), data manager, exceptions and Junit Test (.java) files Javadoc files – The entire doc folder with your javadoc for student generated files Learning Experience document GitHub screen shotDeliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats: LastNameFirstName_AssignmentX.zip [compressed file containing following]: doc [a directory] include the entire doc folder with the javadoc for student generated files file1.html (example) file2.html (example) class-use (example directory) LearningExperience.doc or other text format src [a directory] contains your driver (javafx application), data manager, exceptions and Junit Test (.java) files File1.java (example) File2.java (example) File_Test.java (example) GitHub screen shot. LastNameFirstName_AssignmentX_Moss.zip [compressed file containing only]: .java file which includes the driver (javafx application), data manager, exceptions and Junit Test (.java) files – NO FOLDERS!! File1.java (example) File2.java (example)Grading Rubric CMSC 204 Project #1 Name _____________________________Overview: There are two parts to the rubric. First, the project is graded on whether it passes public and private tests. If it does not compile, a 0 will be given. These points add up to 100. Second, the score is decremented if various requirements are not met, e.g., missing required methods, missing Junit test cases, no Javadoc, no UML diagram, uses constructs that are not allowed, etc.TESTING (100 pts) Compiles 35 pts _____ Student Junit required student tests 8 pts _____ Passes JUnit student tests 7 pts _____ Passes public JUnit tests 15 pts _____ Execution: runs without errors (either run-time or logic errors 20 pts _____ Possible Sub-total 100 pts _____REQUIREMENTS (Subtracts from Testing total)Documentation: Javadoc for student generated files not submitted (entire doc folder) -5 pts _____ Documentation within source code was missing or incorrect -1.5 pts _____ Description of what class does was missing Author’s Name, @author, was missing Methods not commented properly using Javadoc @param, @return JUnit STUDENT methods were not implemented -10 pts _____ Screen shot of GitHub repo with Assignment1 files was not submitted -5 pts _____ MOSS files were not submitted -5 pts _____ Learning Experience -2.5 pts _____ In 3+ paragraphs, highlight your lessons learned and learning experience from working on this project. What have you learned? What did you struggle with? What would you do differently on your next project?Programming Style: Incorrect use of indentation, statements, structures -2 pts _____Design: Implementation does not follow final design -4 pts _____Classes do not have the functionality specified, i.e., 1. PasswordCheckerUtility class -10 pts _____ does not have a method to check validity of password does not have a method to check validity of ArrayList of passwords does not follow the Javadoc provided does not have private method for each password requirement 2. GUI does not compile -5 pts _____ 3. Exceptions classes -10 pts _____ does not have exception class for each invalid password rule does not have exception class for weak password does not have exception class if password and re-type password don’t match does not have exception class for each password requirement Possible decrements: -60 pts _____ Possible total grade: 100 pts _____

$25.00 View

[SOLVED] Cmsc203 –

A property management company manages individual properties they will build to rent, and charges them a management fee as the percentages of the monthly rental amount. The properties cannot overlap each other, and each property must be within the limits of the management company’s plot. Write an application that lets the user create a management company and add the properties managed by the company to its list. Assume the maximum number of properties handled by the company is 5.• Aggregation • Passing object to method • Array Structure • Objects as elements of the Array • Processing array elements • Copy Constructor • Junit testingData Element class – Property.java The class Property will contain: 1. Instance variables for property name, city, rental amount, owner, and plot. Refer to JavaDoc for the data types of each instance variable. 2. toString method to represent a Property object. 3. Constructors and getter and setter methods. Refer to Javadoc of the Property class.Data Element class – Plot.java The class Plot will contain: 1. Instance variables to represent the x and y coordinates of the upper left corner of the location, and depth and width to represent the vertical and horizontal extents of the plot. 2. A toString method to represent a Plot object 3. Constructors, Refer to Javadoc for Plot class. 4. A method named overlaps that takes a Plot instance and determines if it is overlapped by the current plot. 5. A method named encompasses that takes a Plot instance and determines if the current plot contains it. Note that the determination should be inclusive, in other words, if an edge lies on the edge of the current plot, this is acceptable. Data Structure – An Array of Property objects to hold the properties that the management company handles. This array will be declared as an attribute of the ManagementCompany class.Data Manager class – ManagementCompany.java It will contain instance variables of name, tax Id, management fee, MAX_PROPERTY (a constant set to 5) and an array named properties of Property objects of size MAX_PROPERTY, as well as two constants MGMT_WIDTH and MGMT_DEPTH, both set to 10; an attribute plot of type Plot that defines the plot of the ManagementCompany Class. Refer to Javadoc for more details. The class ManagementCompany will contain the following methods in addition to get and set methods: 1. Constructors (refer to Javadoc for more details) 2. Method addProperty (3 versions): 2.1.1. Pass in a parameter of type Property object (calls Property copy constructor). It will add the copy of the Property object to the properties array. 2.2. Method addProperty version 2: 2.2.1. Pass in four parameters of types: • String propertyName, • String city, • double rent, • String ownerName. 2.2.2. Calls Property 4-arg constructor. 2.3. Method addProperty version 3: 2.3.1. Pass in eight parameters of types: • String propertyName, • String city, • double rent, • String ownerName, • int x, • int y, • int width • int depth. 2.3.2. Calls Property 8-arg constructor. 2.4. addProperty methods will return the index of the array where the property is added. If there is a problem adding the property, this method will return -1 if the array is full, -2 if the property is null, -3 if the plot for the property is not encompassed by the management company plot, or -4 if the plot for the property overlaps any other property’s plot. 3. Method totalRent– Returns the total rent of the properties in the properties array.4. Method maxRentPropertyIndex- returns the index of the property within the properties array that has the highest rent amount. This method will be private. 5. Method maxRentProp- Returns the highest rent amount of the property within the properties array. For simplicity assume that each “Property” object’s rent amount is different. This method should call the maxRentPropertyIndex method. 6. Method toString- returns information of ALL the properties within this management company by accessing the “Properties” array. The format is as following example:List of the properties for Alliance, taxID: 1235 ______________________________________________________ Property Name : Belmar Located in Silver Spring Belonging to:John Smith Rent Amount: 1200.0 Property Name : Camden Lakeway Located in Rockville Belonging to:Ann Taylor Rent Amount: 2450.0 Property Name : Hamptons Located in Rockville Belonging to:Rick Steves Rent Amount: 1250.0 ______________________________________________________total management Fee: 294.0Driver class – (provided) The provided PropertyMgmDriverNoGui.java is a class that allows you to test the methods of ManagementCompany.javaGUI Driver class – (provided) A Graphical User Interface (GUI) is provided. Be sure that the GUI will compile and run with your methods. The GUI will not compile if your methods in ManagementCompany.java are not exactly in the format specified. Do not modify the GUI.JUnit Test Run the JUnit test file (provided). Ensure that the JUnit tests all succeed. Do not modify the JUnit tests. Implement your tests in ManagementCompanyTestSTUDENT. These tests should be similar to the Junit tests.Write a Data Element Class named Property that has fields to hold the property name, the city where the property is located, the rent amount, the owner’s name, and the Plot to be occupied by the property, along with getters and setters to access and set these fields. Write a parameterized constructor (i.e., takes values for the fields as parameters) and a copy constructor (takes a Property object as the parameter). Follow the Javadoc file provided.A driver class is provided that creates rental properties to test the property manager. A Graphical User Interface is provided using JavaFX which duplicates this driver’s functionality. You are not required to read in any data, but the GUI will allow you to enter the property management company and each property by hand. A directory of images is provided. Be sure to place the “images” directory (provided) inside the “src” directory in Eclipse. The images do not need to display in order for the GUI to continue running.Upload the initial files from Blackboard and your final java files to GitHub in your repo from Lab 1, in a directory named CMSC203_Assignment4.Operation When driver-driven application starts, a driver class (provided) creates a management company, creates rental properties, adds them to the property manager, and prints information about the properties using the property manager’s methods. When the GUI-driven application starts (provided), a window is created as in the following screen shots which allows the user to enter applicable data and display the resulting property. The driver and the GUI will both use the same classes and methods for their operation. The JUnit test class also tests the same classes as the driver and the GUI. Expected output from running PropertyMgmDriverNoGui.javaExpected output from running with GUI:PropertyMgmGui.java at startupAdd Management Co Info (Note Mgmt Co Plot)Add property information – the Plot outlineAdd property information – successful additionAdd property information – unsuccessful: overlapsAdd property information – unsuccessful: Mgmt Co Plot does not encompass Property Plot Note: red rectangle’s width extends to right of window.Add property information – unsuccessful: too many propertiesResult of “Max Rent” button Result of “Total Rent” buttonResult of “List of Properties” button• Turn in a UML class diagram in a Word document. • Submit pseudo-code for the primary methods specified in ManagementCompany.java, Property.java, and Plot.java in a Word document. Do not just list what gets read in a printed out, but explain the algorithm being used. • Learning Experience: highlight your lessons learned and learning experience from working on this project. o What have you learned? o What did you struggle with? o What will you do differently on your next project? o Include what parts of the project you were successful at, and what parts (if any) you were not successful at. • GitHub: In your repository (see Lab 1), upload your Word file and java file. You will want to upload these files as contents of a directory so that future uploads can be kept separate. Take and submit a screen shot of the GitHub repository. Notes: • Proper naming conventions: All constants, except 0 and 1, should be named. Constant names should be all upper-case, variable names should begin in lower case, but subsequent words should be in title case. Variable and method names should be descriptive of the role of the variable or method. Single letter names should be avoided. Indentation: It must be consistent throughout the program and must reflect the control structureSubmission Detail Submit the following files: • Word document with a name FirstInitialLastName_Assignment3.docx should include: o UML Class Diagram o Pseudocode for each of the methods specified in ManagementCompany.java, Property.java, and Plot.java. o Screen snapshots of the GUI with several properties o Screen snapshot of GitHub submission o Lessons Learned o Check List o doc (a directory) containing your javadoc files o src (a directory) contains your (.java) files o File1.java (example) ▪ File2.java (example) ▪ File_Test.java (example)• A zip file will only contain the .java files and will be named: FirstInitialLastName_Assignment4_Moss.zip. This .zip will not have any folders in it – only .java files.Grading Rubric See attachment: CMSC203 Assignment 4 Rubric_Summer20.xlsxAssignment 4 Check List # Y/N Comments 1. Assignment files: • FirstInitialLastName_ Assignment#_Moss.zip • FirstInitialLastName_Assignment#.docx/.pdf • Source java files 2. Program compiles 3. Program runs with desired outputs related to a Test Plan 4. Documentation file: • Comprehensive Test Plan • Screenshots for each Test case listed in the Test Plan • Screenshots of your GitHub account with submitted Assignment# (if required) • UML Diagram • Algorithms/Pseudocode • Flowchart (if required) • Lessons Learned • Checklist is completed and included in the Documentation

$25.00 View