Implement a Java class for a Queue Besides a constructor, you must implement the instance methods: Computer science Assignment, UCD, Ireland

2 Assignment Details

The details for this assignment are as follows.

◦ Implement a Java class for a Queue.

1 Besides a constructor, you must implement the instance methods: size( ), add( ), element( ), peek( ), poll( ), and remove( ) which should all have the usual semantics. Your class does not have to implement the official Queue interface but it should support the six instance methods listed before.

Implement seven (no more, no less) meaningful unit tests for the instance methods of the Queue class. There should be at least one test for each of the instance methods. The tests should not be about time- and performance-related issues.

◦ Implement an Ant script that automates project building, unit testing, documentation generation, and all other related work.

◦ Implement a short Main class with a main( ) function that demonstrates the functionality of the Queue class.

◦ Document your Java classes with JavaDoc.

◦ Version control your project with Git.

The project must have master branch for the main project and development branches for the sub-tasks of the project (unit testing, java, shell scripting, build tools).

You must merge the relevant branches with the master branch on a regular basis.2?

To simulate a proper version control cycle, you must have at least three implementation sessions in the first three days of your assignment. At the end of each session you should save the current state of your project using a version control command.? There should be at least two implementation sessions in the remaining days.

At the end of each session you should save the current state of your project using a version control command.

Please note that this means that you should start version controlling your project during the first session of the first day of the project.

At the end of the first implementation session of the third day of the project you must simulate a mistake. The mistake should be a simple syntax error in your main class: simply insert the word error on the first line of the main class.

In the second implementation session on the third day you should correct/undo the error using version control. You may use any version control command, but simply removing the syntax error with a regular editing session isn’t allowed: you must use version control. The last paragraph of your README should explain how you corrected the simulated implementation

The project structure should be clean, with only the README and the Ant build file hanging around in the top-level directory. All other files should be in dedicated subdirectories.

Implement a Bourne shell script called my-backup, which makes a snapshot of your project and copies it to a designated sub-directory of your project, which should be called back up. The my-backup command should be under version control but it should not rely on version control commands. The backup directory should not be version-controlled: this part of the assignment is to test your skills about the Bourne shell.

The my-backup command should recursively copy all regular files and directories in your project, except for the backup directory and hidden files (files with names starting with .).

If the backup directory doesn’t exist then the my-backup command should create the backup directory.

Each time you run my-backup it should back up your project in a dedicated sub-directory of the backup directory.

The names of the dedicated sub-directories should be yyyy-mm-dd-xxx, where yyyy is a 4-digit number for the current year, mm is a 2-digit number for the current month, dd is a 2-digit number for the current day of the month, xxx is a 3-digit number for the number of the backup for that day. E.g. the first backup of August 10, 2020, should be named 2020-08-10-001, the second 2020-08-10-002, and so on.

Hint: use cp, command substitution, date, expr, test, and some other tools.

◦ Use Java as your programming language and JUnit for unit testing.

◦ Your version control-related work must be done with command-line Git: you may not (as in not: definitely not) use GitHub or other version control command-line tools or ides.

◦ You must use Ant as your build tool. Your main Ant script should have targets help, compile, JUnit, and javadoc with the “expected” semantics. In addition there should be a target submit, which is for “submitting” the project. This target should create the Canvas submission file of your project.

◦ All Java, Ant, bash/sh, and JUnit files should be version-controlled.

◦ Implement a plain text file which should be named README and which should explain your project organization, how to build it, and how to carry out the unit tests, …For simplicity I suggest you use delegation to build your Queue class.

2 This may not be recommended practice but you must demonstrate you can do the merging.


All files in the project should be properly commented.

4 Compatibility

Your submission should work with the javac, java, Git, Ant, and JUnit versions: javac 1.8.0_251;

java java version “1.8.0_251” Java(TM) SE Runtime Environment (build 1.8.0_251-b08);

Ant Apache Ant(TM) version 1.9.6;

JUnit 4.12;

Git version 2.7.4.

Get Solution of this Assessment. Hire Experts to solve this assignment for you Before Deadline.
Get A Free Quote

The post Implement a Java class for a Queue Besides a constructor, you must implement the instance methods: Computer science Assignment, UCD, Ireland appeared first on QQI Assignments.

Assignment Helper
Get professional help now
Assignment Helper
Hi there
How can I help you?
Just Now

Get 35% off your Assignments