Define a class 'Human' having data members name and gender. Create classes 'Woman' and 'Man'...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
• Define a class 'Human' having data members name and gender. • Create classes 'Woman' and 'Man' derived from 'Human' having data member age in both. Both classes must have a constructor to initialize all data members (including super class). • Create 6 objects, 3 objects of 'Man' and 3 objects 'Woman'. • Define method find (), this must implement the override method in the super class 'Human' to pass objects of 'Man' and 'Woman'. This method should display all the information and it will find who is the senior person and who is younger person. Write a test program that: • Creates an Array of object named List to holds the created objects (you can create it either in the main class or as a sperate method). • Adds the 6 human objects in the List array, by asking the user, how many persons you want to enter. Then start to enter the person's information by keyboard. • Displays the women and men information's The information that your program should be displayed are: - Name, gender, and age. - The senior person with his/her information (Name, gender, and age). Younger person with his/her information (Name, gender, and age). • Define a class 'Human' having data members name and gender. • Create classes 'Woman' and 'Man' derived from 'Human' having data member age in both. Both classes must have a constructor to initialize all data members (including super class). • Create 6 objects, 3 objects of 'Man' and 3 objects 'Woman'. • Define method find (), this must implement the override method in the super class 'Human' to pass objects of 'Man' and 'Woman'. This method should display all the information and it will find who is the senior person and who is younger person. Write a test program that: • Creates an Array of object named List to holds the created objects (you can create it either in the main class or as a sperate method). • Adds the 6 human objects in the List array, by asking the user, how many persons you want to enter. Then start to enter the person's information by keyboard. • Displays the women and men information's The information that your program should be displayed are: - Name, gender, and age. - The senior person with his/her information (Name, gender, and age). Younger person with his/her information (Name, gender, and age).
Expert Answer:
Answer rating: 100% (QA)
Answerpublic class Human String name String gender public static void main String ar... View the full answer
Related Book For
Database Systems Design Implementation and Management
ISBN: 978-1337627900
13th edition
Authors: Carlos Coronel, Steven Morris
Posted Date:
Students also viewed these programming questions
-
Write a program that creates an array of 10 elements size. Your program should prompt the user to input numbers in array and then display the sum of all array elements.
-
Write a program that creates an array of at least 20 integers and do the following: Prompt the user for a starting position, and continually reprompts the user for a new value if the starting...
-
Write a complete C++ program that creates an Alligator class and uses objects of this class. The Alligator class consists of following components. Properties (using public access modifier): weight:...
-
Scenic Ventures is considering an investment in a start-up firm offering ecotourism excursions in Costa Rica. Scenic Ventures estimates that, if the venture is successful, the ecotourism company will...
-
Allegiance Insurance Company sends a questionnaire to policyholders who have filed a claim. The questionnaire asks these claimants whether they are satisfied with the way the claim has been handled....
-
Tom is climbing a 3.0-m-long ladder that leans against a vertical wall, contacting the wall 2.5 m above the ground. His weight of 680 N is a vector pointing vertically downward. (Weight is measured...
-
The adjusted trial balances of PDQ, Inc., at December 31,2010, and December 31, 2011, include these amounts: Requirement 1. Compute the amount of supplies expense, salary expense, and service revenue...
-
A ccess the FASBs Codification Research System at the FASB website (www.fasb.org). Required: Determine the specific citation for accounting for each of the following items: 1. If it is only...
-
Perform a first derivative test on the function f(x) = 2x3 +9x2-24x+3; [-4,5] a. Locate the critical points of the given function. b. Use the First Derivative Test to locate the local maximum and...
-
In this mini-case you will perform some procedures required as a part of audit planning. For ease your audit manager has already organized the workpapers and completed several of the required...
-
Bambazonke plans to sell 8 3 , 0 0 0 units of product number 7 9 4 in May, and each of these units requires three units of raw material. Pertinent data follow. Product Number 7 9 4 Raw Material...
-
Visit rankur at https://rankur.com and read about the services the company offers. Some analysts have referred to the practice of mining social media as being similar to conducting a focus group. Is...
-
What type of exploratory research design (observation, projective technique, in-depth interview, focus group, case study, ethnography, netnography, ZMET) would you suggest for each of the following...
-
A balanced three-phase 208-V source supplies a balanced three-phase load. If the line current \(I_{A}\) is measured to be \(10 \mathrm{~A}\) and is in phase with the line-to-line voltage...
-
As the Internet has grown as a medium for conducting various types of marketing research studies, there is growing concern about ethical issues. Identify and discuss three ethical issues pertinent to...
-
Visit C Space at https://cspace.com. Read the information about what the company does and some of the news or case histories at its site. After reviewing the website, evaluate whether and to what...
-
Write a program that allows the user to enter a time in minutes and then displays the time in hours: minutes format. The program output should look similar to: Enter the number of minutes: 327 This...
-
Find i 0 (t) for t > 0 in the circuit in Fig. 16.72 . 2 + Vo 1 7.5e-2t u(t) V ( +) 4.5[1 u(t)]V 0.5v. 1H
-
A table is in ___3rd___ normal form when it is in ___2 nd normal form___ and there are no transitive dependencies.
-
How would you describe a condition in which one attribute is dependent on another attribute when neither attribute is part of the primary key?
-
Based on the following query: SELECT P_CODE, SUM(LINE_UNITS) FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) > (SELECT MAX(LINE_UNITS) FROM LINE); Write the command to create statistics for this...
-
The suspension system of a car traveling on a bumpy road has a stiffness of \(k=5 \times 10^{6} \mathrm{~N} / \mathrm{m}\) and the effective mass of the car on the suspension is \(m=750...
-
The history of statistical hypothesis testing really began with a tea-tasting experiment (Fisher, 1935), so it seems fitting for this book to end with one. (This is also a fitting ending because...
-
In Laplace domain, \(\lim _{s ightarrow 0}[s X(s)]\) gives the: a. initial value b. transient value c. steady-state value
Study smarter with the SolutionInn App