Subclass3. Quality if factored into your grades. Students who expend minimal effort on this assignment will...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Subclass3. Quality if factored into your grades. Students who expend minimal effort on this assignment will not earn full credit. For each class you create, include: At least 3 additional pieces of instance data items (notice how Human had 4 additional items). Points are awarded for well-designed classes. Use relevant data items which are appropriate for the creature. Do not mirror the Human class. Make sure your data items are unique. Your child classes should not mirror each other. Minimal effort is awarded minimal points. Constructors for the new classes (don't forget the call to the parent using super() refer to Human, as needed). Accessors and mutators for the new instance data items. An updated toString() method - refer to Human as an example. An overridden superPower( ) method - refer to Human as an example. Points are awarded for well- designed methods. Creativity factors into your grade. Proper use of inheritance (using super( ) to avoid duplication of code). Points are awarded for well- designed methods. The toString() method should be relevant and make sense. O o Include data validation where appropriate (for parameters values). O Step 2: Testing the new Creature Classes Create a new driver program that displays the data in a better format than was provided. Instantiate (with data) at least one object from each of the new classes you defined. Document this coding section well. Display each of the new objects using the toString() methods of each class. Document this coding section well. Include headings in the output indicating the toString() methods are used. Display each object using accessors rather than the toString() methods. Make sure you use each of the accessors from each class. This is testing each of your accessors. Document this coding section well. Include headings in the output indicating the accessors are used. Update each object by using the mutators for each object. Make sure you use each mutator from each class. Document this coding section well. Include headings in the output indicating the mutators are used. o Display the old data and new data for each change. Unfortunately, one of your creatures died. Use the proper mutators in the LivingCreature class to change the settings for isAlive and dateOf Death. Document this coding section well. Include headings in the output indicating the methods from LivingCreature is used. o Display the old data and new data for the change. Step 3: Describe your classes In a Word document or other file saved as a PDF file, describe IN DETAIL your subclasses. Describe the data items you included and why. Your grade will reflect how well you planned your creature classes. Zip all of .java files together, including your driver, and your Word or PDF file. Submit in Blackboard for grading. Restrictions: You are not to use arrays for this assignment. This is an assessment of our basic knowledge and understanding of Java inheritance. SOFTWARE REQUIREMENTS R1: Properly create the 3 subclasses of LivingCreature. R2: Use the call to the parent (super) where appropriate. R3: Do not duplicate code from the parent in the child. R4: R5: Define the abstract superPower() method in each of the child classes. Create a drive that tests the child classes as described in the narrative. Document the classes and drivers thoroughly. R6: R7: Create a separate documentation file (Word or PDF file) to describe your classes in detail. SECURITY CONSIDERATIONS Classes should validate method parameters, use private instance data items, and only provide accessors and mutators where needed and necessary. Child classes and parent classes can share data and still include proper security. Pay attention to the access modifier (private, protected, and public) and use them properly. NARRATIVE DESCRIPTION Bluegrass Community and Technical College Programming Requirements Document Inheritance Attached to this assignment in Blackboard is a LivingCreature class. This is a parent class. Look over the code. You will notice it has 4 instance data items: isAlive: a Boolean variable which indicates whether or not the living creature is alive (true or false) dateOfBirth: a String variable which indicates the birthdate of the creature (mm/dd/yyyy) dateOfDeath: a String variable which indicated the date the creature died (if the creature is not alive) description: a String variable that describes the creature The LivingCreature contains two constructors, accessors, mutators, and a toString() method. This code is similar to what you are accustomed to seeing in a class from Chapter 5. The LivingCreature class is an abstract class because it has one method, the superPower() method, which is not defined. This means any class that is a child class of LivingCreature would need to define superPower() (unless it too is an abstract class). Also attached to this assignment is a sample child class named Human and a driver named Creature Test. Compile all three java files and run the driver. Pay attention to how the child class uses the parent class (in the constructors, in the toString method, and by defining the superPower() method). Step 1: Create Child Classes (Subclasses) of LivingCreature Create 3 new and different subclasses of LivingCreature. Two should be inherited from LivingCreature. The third subclass should be inherited from one of the first two subclasses you created. Living Creature Subclass1 Subclass3 Subclass2 You are not to use any examples from the Internet or textbooks. Use your imagination and what you have learned about inheritance to complete this assignment. You may choose animals, plants, mythical creatures, etc. NOTE: You should name the classes with descriptive names. Do not use Subclass1, Subclass2, and Subclass3. Quality if factored into your grades. Students who expend minimal effort on this assignment will not earn full credit. For each class you create, include: At least 3 additional pieces of instance data items (notice how Human had 4 additional items). Points are awarded for well-designed classes. Use relevant data items which are appropriate for the creature. Do not mirror the Human class. Make sure your data items are unique. Your child classes should not mirror each other. Minimal effort is awarded minimal points. Constructors for the new classes (don't forget the call to the parent using super() refer to Human, as needed). Accessors and mutators for the new instance data items. An updated toString() method - refer to Human as an example. An overridden superPower( ) method - refer to Human as an example. Points are awarded for well- designed methods. Creativity factors into your grade. Proper use of inheritance (using super( ) to avoid duplication of code). Points are awarded for well- designed methods. The toString() method should be relevant and make sense. O o Include data validation where appropriate (for parameters values). O Step 2: Testing the new Creature Classes Create a new driver program that displays the data in a better format than was provided. Instantiate (with data) at least one object from each of the new classes you defined. Document this coding section well. Display each of the new objects using the toString() methods of each class. Document this coding section well. Include headings in the output indicating the toString() methods are used. Display each object using accessors rather than the toString() methods. Make sure you use each of the accessors from each class. This is testing each of your accessors. Document this coding section well. Include headings in the output indicating the accessors are used. Update each object by using the mutators for each object. Make sure you use each mutator from each class. Document this coding section well. Include headings in the output indicating the mutators are used. o Display the old data and new data for each change. Unfortunately, one of your creatures died. Use the proper mutators in the LivingCreature class to change the settings for isAlive and dateOf Death. Document this coding section well. Include headings in the output indicating the methods from LivingCreature is used. o Display the old data and new data for the change. Step 3: Describe your classes In a Word document or other file saved as a PDF file, describe IN DETAIL your subclasses. Describe the data items you included and why. Your grade will reflect how well you planned your creature classes. Zip all of .java files together, including your driver, and your Word or PDF file. Submit in Blackboard for grading. Restrictions: You are not to use arrays for this assignment. This is an assessment of our basic knowledge and understanding of Java inheritance. SOFTWARE REQUIREMENTS R1: Properly create the 3 subclasses of LivingCreature. R2: Use the call to the parent (super) where appropriate. R3: Do not duplicate code from the parent in the child. R4: R5: Define the abstract superPower() method in each of the child classes. Create a drive that tests the child classes as described in the narrative. Document the classes and drivers thoroughly. R6: R7: Create a separate documentation file (Word or PDF file) to describe your classes in detail. SECURITY CONSIDERATIONS Classes should validate method parameters, use private instance data items, and only provide accessors and mutators where needed and necessary. Child classes and parent classes can share data and still include proper security. Pay attention to the access modifier (private, protected, and public) and use them properly. NARRATIVE DESCRIPTION Bluegrass Community and Technical College Programming Requirements Document Inheritance Attached to this assignment in Blackboard is a LivingCreature class. This is a parent class. Look over the code. You will notice it has 4 instance data items: isAlive: a Boolean variable which indicates whether or not the living creature is alive (true or false) dateOfBirth: a String variable which indicates the birthdate of the creature (mm/dd/yyyy) dateOfDeath: a String variable which indicated the date the creature died (if the creature is not alive) description: a String variable that describes the creature The LivingCreature contains two constructors, accessors, mutators, and a toString() method. This code is similar to what you are accustomed to seeing in a class from Chapter 5. The LivingCreature class is an abstract class because it has one method, the superPower() method, which is not defined. This means any class that is a child class of LivingCreature would need to define superPower() (unless it too is an abstract class). Also attached to this assignment is a sample child class named Human and a driver named Creature Test. Compile all three java files and run the driver. Pay attention to how the child class uses the parent class (in the constructors, in the toString method, and by defining the superPower() method). Step 1: Create Child Classes (Subclasses) of LivingCreature Create 3 new and different subclasses of LivingCreature. Two should be inherited from LivingCreature. The third subclass should be inherited from one of the first two subclasses you created. Living Creature Subclass1 Subclass3 Subclass2 You are not to use any examples from the Internet or textbooks. Use your imagination and what you have learned about inheritance to complete this assignment. You may choose animals, plants, mythical creatures, etc. NOTE: You should name the classes with descriptive names. Do not use Subclass1, Subclass2, and
Expert Answer:
Answer rating: 100% (QA)
It looks like youre working on an assignment that involves creating Java classes for different types of creatures implementing inheritance and testing ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
You have been employed to create program to assist the manager of a coffee shop. You decide to make a prototype application in Java to show what you can do, and to be able to ask the manager what...
-
Requirement 1. Journalize the partners' initial contributions. (Record debits first, then, credits. Select the explanation on the last line of the journal entry table.) Begin by journalizing the...
-
Explain the impact of a mismatch in supply and demand. What strategies can companies adopt to influence demand?
-
The U.S. Census Bureau provides data on the number of young adults, ages 1824, who are living in their parents home.1 Let M = the event a male young adult is living in his parents home F = the event...
-
The black lines show the emission or absorption lines observed in two spectra of the same element. Which one is an emission spectrum and which is an absorption spectrum? . .
-
Bartling Energy Systems recently reported $9,250 of sales, $5,750 of operating costs other than depreciation, and $700 of depreciation. The company had no amortization charges, it had $3,200 of...
-
Finding the right approach means testing, testing and more testing. You must think outside of the box as you test different strategies and schedule influences. Your budget for this round is also...
-
What strategies can be employed to mitigate communication barriers arising from cognitive biases, linguistic ambiguities, or perceptual filters, thereby promoting clarity and alignment in message...
-
A) After watching the current richest person in the world and the 5 richest ones in 2020 (click the blue text for hyperlinks ), suppose if you were one of them as the richest people in the world, do...
-
Question 4 A.A private college adds a small caf to its building to cater to the needs of its own students. The total cost of the facilities for the caf is $100,000. After a year of operations, the...
-
1. Pakistan was accorded the sectoral dialogue status of ASEAN at the 26th ASEAN Ministerial Meeting on 23 July 1993. 2. The inaugural meeting to establish the ASEAN-Pakistan Sectoral Dialogue...
-
Population growth leads to increased industrial output and societal well-being until 2030, after which a crash occurs. Stable population and industrial output lead to a gradual improvement in...
-
Choose a project that you have worked with in your organisation and define clearly, what is meant by resource smoothing. Thereafter, proceed to elucidate the steps that you, as the project manager,...
-
Identify and describe at least two competing needs impacting your selected healthcare issue/stressor. Describe a relevant policy or practice in your organization that may influence your selected...
-
Big Jim Company sponsored a picnic for employees and purchased a propane grill equipped with a standard-sized propane tank for the picnic. To make sure there was enough propane for all the cooking...
-
During 2012, Tom sold Sears stock for $10,000. The stock was purchased 4 years ago for $13,000. Tom also sold Ford Motor Company bonds for $35,000. The bonds were purchased 2 months ago for $30,000....
-
During the 2012 tax year, Irma incurred the following expenses: Union dues..............................................................$275 Tax return preparation...
-
If Charles, a 16-year-old child model, earns $50,000 a year and is completely self supporting even though he lives with his parents, can his parents claim him as a dependent? Why or why not?...
-
Terms a Split-off point b Joint cost c Separable cost d By-product e Joint product f Product Definitions 1 Product with low sales value compared with the sales value of the main or joint product(s)....
-
Milj-Spe AS produces two joint products, cooking oil and soap oil, from a single vegetable oil refining process. In July 2022, the joint costs of this process were NOK 24 000 000. Separable...
-
Claude Deux-Bussy is the owner and operator of Boissons Barbe-Bleue Sarl, a bulk soft-drink producer. A single production process yields two bulk soft drinks, Pellas (the main product) and Mlisande...
Study smarter with the SolutionInn App