CSC115 Assignment 2 non-static methods solution


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (7 votes)

• Experience working with Objects and Arrays in Java
• Experience writing both static and non-static methods
• Further experience with code testing and debugging
This assignment requires you to implement and test non-static methods in the Date class for Part 1, and
then implement and test static methods in the A2Exercises class for Part 2.
Although there is a tester provided for this assignment, it does not include a comprehensive set of sets for
each method. You should add your own tests for any test cases not considered.
Note: The automated grading of your assignment will include some different and additional tests to those
found in the file.
Quick Start
1. Download all of the .java files found in the Resources > Assignments > a2 folder.
2. Compile and run
3. Open the file. Read through the tests for testDateConstructor to see what the
expected behaviour is for the second Date constructor. Implement the second Date constructor,
save, and then recompile and run If any tests fail, fix the errors until all of the tests
pass for that method. Add any tests that you feel are necessary.
4. After finishing your implementation of the second Date constructor, uncomment the second test
method in (testEquals). Follow the same process that you did in step 3. until you are
certain the equals method has been implemented correctly in the Date class.
5. Continuing moving down one test method at a time until all of the required methods have been
implemented. Remember to write additional tests until you are sure that your implementation will
work correctly under all different possible input scenarios.
CRITICAL: Any compile or runtime errors will result in a zero grade (as if the tester crashes it will not
be able to award you any points for any previous tests that may have passed). Make sure to compile and
run your program before submitting it!
Submission and Grading
Submit and with your name and student ID at the top of each file using ConneX.
If you chose not to complete some of the methods required, you must provide a stub for the incomplete
method(s) in order for our tester to compile (there are stubs for each method right now, which is why it
will compile without issue). If you submit files that do not compile with our tester, you will receive a zero
grade for the assignment. It is your responsibility to ensure you follow the specification and submit the
correct files. Additionally, your code must not be written to specifically pass the test cases in the tester,
instead, it must work on all valid inputs. We may change the input values when we run the tests and we
will inspect your code for hard-coded solutions.
Be sure you submit your assignment, not just save a draft. ALL late and incorrect submissions will be
given a ZERO grade. A reminder that it is OK to talk about your assignment with your classmates, but not to
share code electronically or visually (on a display screen or paper). We will be using plagiarism detection