5/27/2021 Assignment https://scis.lms.athabascau.ca/mod/assign/view.php?id=39107 1/2 Java Programs When a program requires user input, you must be sure to incorporate user information in your program;...

1 answer below »
please ask the tutor to note interesting - trial and error type things he/she experienced during coding. Any debugging they had to do etc. That would be helpful.


5/27/2021 Assignment https://scis.lms.athabascau.ca/mod/assign/view.php?id=39107 1/2 Java Programs When a program requires user input, you must be sure to incorporate user information in your program; that is, if a program requires an argument, then omitting the argument should generate a message that informs the user as to the type of input required. All programs must have appropriate output information displays and user prompts as necessary. Complete, working, and tested programs are required to solve the following exercises. See Documentation and Test Plans for required documentation. In the programs for this assignment, class names have been specified. You must use the supplied class name for both class and source file name (i.e., Animal will be in a file Animal.java). If a program specifies multiple classes, then each class should be in its own separate source file. DO NOT use packages in your programs. All programs for this assignment should reside, compile, and execute from a single working directory. 1. Write a class called Animal with overload sound() methods. These methods should be overloaded based on various primitive data types and print different types of animal sounds (“oink,” “honk,” etc.) depending on which overload version is called. You may use the program you wrote for Assignment 1, question 4 as a starting point. Create child classes for Pig, Sheep, Duck, and Cow. Every child class has its override sound() method, and the override method will call the appropriate overload sound() method according to what animal it represents. Write a main() that creates instances of different animals, and calls these animal instances sound() method, so different animals will print different sounds accordingly. Note: The sound() method does not generate the sound; it only prints the sound word to output. 2. Define a class called Book. This class should store attributes such as the title, ISBN number, author, edition, publisher, and year of publication. Provide get/set methods in this class to access these attributes. Define a class called Bookshelf, which contains the main method. This class should create a few book objects with distinct names and store them in an ArrayList. This class should then list the names of all books in the ArrayList. Enhance the program by providing a sort function, which will sort the books in ascending order of their year of publication. Create a few more Book objects with the same names but with different edition numbers, ISBNs, and years of publication. Add these new Book objects to the ArrayList, and display the book list sorted by book name; for duplicate books of the same name, sort the list by year of publication. (Hint: You will need to define a comparator class that takes two Book objects as parameters of the compareTo method. This method should do a two-step comparison and return a Boolean value. The first comparison should compare the name of the book. If the name is the same, the second comparison should compare the year of publication.) Documentation and Test Plans 5/27/2021 Assignment https://scis.lms.athabascau.ca/mod/assign/view.php?id=39107 2/2 You may have encountered documentation and test plans in other courses or at your workplace. For this course, the following are mandatory and should be followed. If the standards for this course differ from others in your past experience, then, for these assignments, the standards of this course supercede all other standards. At the top of every source file, you must place three comment blocks. The first comment block contains your name, student ID, date, assignment number, program name, and a brief program description. The second comment block is the primary documentation for your program. Explain the program purpose, code behaviours, and any particulars of the program. Also include detailed instructions for compiling and executing the program, including example input data if required. Also list separately all classes and instance variables used in the program, with descriptions. The third comment block is the test plan. At its core, a test plan simply tells another person how the program actually worked during testing. In cases where there is no input, there is still often output, so you can still show exactly how the program should function. In programs with input, you can also describe various test cases, including those where incorrect data (or no data) is entered and what output should be expected. Finally, the test plan is a place to discuss limitations of your program and things that could be done to improve it. If you write a program with multiple classes, the first two comment blocks must appear in every source (class) file. The test plan comment block should only appear in the source file that contains the main()method used for testing. Failure to provide all three comment blocks will result in loss of marks, as noted below in Marking Scheme. The program “GoodDocs.java” is provided as a complete working example of a program documented to the standards of this course. (See Resources & Tools in the right-hand column of the course home page.) Deliverables Be sure your working directory contains only source code files and any necessary input files as required by the assignment. Zip this directory into a single zip file and then upload it using the assignment drop box. https://comp501r6.athabascau.ca/resources/GoodDocs.java
Answered 23 days AfterMay 28, 2021

Answer To: 5/27/2021 Assignment https://scis.lms.athabascau.ca/mod/assign/view.php?id=39107 1/2 Java Programs...

Arun Shankar answered on Jun 01 2021
137 Votes
__MACOSX/._Java001Assignment
Java001Assignment/Documentation.pdf
Documentation
1. General Instructions:
The assignment exercises do not require any input from the user but will produce
output. Everything required to execute the program is provided in the main() method.
Documentation as given in
the example file is being implemented. For the Bookshelf
class, create more book instances if needed. I’ve created 5 books with 2 books being
duplicates, ie., having the same title but other parameters are different.
All the programs are written with proper commenting and in accordance with the
marking scheme. All the programs compile and run successfully.
PS : You only need to run the classes that have the main function in them. That
is, you only need to run Animal.java and Bookshelf.java and it’ll do the rest.
2. Classes Associations :
Animal class has associations with Cow, Dog, Pig and Sheep. Bookshelf class has
associations with Book, sortByYearOfPublication and sortByTitle
3. Requirements :
Java must be installed in order to compile and run the programs.
An IDE will be beneficial if any edits are to be done and also for easy build and run.
Suggested IDE : IntelliJ
4. Source code :
All files are included in the zip, under the src folder.
5. What you must do :
● Make sure you include the Student ID and other requested personal details in
each of the main files.
● Include additional Book instances for Bookshelf class if needed.
__MACOSX/Java001Assignment/._Documentation.pdf
Java001Assignment/.DS_Store
__MACOSX/Java001Assignment/._.DS_Store
__MACOSX/Java001Assignment/._out
Java001Assignment/Java001Assignment.iml









__MACOSX/Java001Assignment/._Java001Assignment.iml
__MACOSX/Java001Assignment/._.idea
__MACOSX/Java001Assignment/._src
Java001Assignment/out/.DS_Store
__MACOSX/Java001Assignment/out/._.DS_Store
__MACOSX/Java001Assignment/out/._production
Java001Assignment/.idea/.gitignore
# Default ignored files
/shelf/
/workspace.xml
__MACOSX/Java001Assignment/.idea/._.gitignore
Java001Assignment/.idea/workspace.xml














































































1623822015021


1623822015021



__MACOSX/Java001Assignment/.idea/._workspace.xml
Java001Assignment/.idea/modules.xml






__MACOSX/Java001Assignment/.idea/._modules.xml
Java001Assignment/.idea/misc.xml



...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here