Implement a base class person

Assignment Help JAVA Programming
Reference no: EM13842162

Part A

· Consider the following classes B and D:

Class B

{

Public;

B();

B( int n);

};

B::B()

{

cout << "B::B()\n";

}

B::B(int n)

{

cout << "B::B(" << n << ")\n";

}

Class D : Public B

{

public:

D();

D( int n);

private:

B b;

};

D::D()

{

cout << "D::D()\n";

}

D::D(int n) : B(n)

{

b = B(-n);

cout << "D::D("<< n <<")\n";

}

What does the following program print?

int main()

{

D d(3);

return 0;

}

· Determine the answer by hand, not by compiling and running the program.

OUTPUT:

Part B

· Implement a base class person. Derive classes Student and Professor from Person. Every Person has will have a name, and birthdate. Every student will have a major, and every professor will have an income. Write the class definitions, the constructors, and the member functions print() for all classes.

Reference no: EM13842162

Questions Cloud

Analyze effects of malnutrition and starvation : Effects of starvation: Analyze effects of malnutrition and starvation on individual mental and physical health, as well mention possible social consequences. Conclude what starvation effects you consider most important.
Why is life expectancy longer for women : Why is life expectancy longer for women than it is for men? Make sure to consider health, social, nutritional, genetical and behavioral differences between men and women, and demonstrate, on the example of a concrete country/culture, why women would ..
Analysis of the levels of leadership theory : An analysis of the levels of leadership theory that are presented in this case. Also, be sure to examine ethical issues as they relate to this case. What ethical dilemmas could be occurring? What leadership styles are evident from the actions of H..
What are the implications of benedict claim : What are the implications of Benedict's claim that morality is simply whatever a culture deems normal behavior? Is this a satisfactory equation? Can you apply it to the institution of slavery or the Nazi policy of anti-Semitism
Implement a base class person : Implement a base class person
Payoffs always represent profits in decision analysis : Payoffs always represent profits in decision analysis problems. As the name suggests, the maximum likelihood criterion says to focus on the largest payoffs. Using Bayes' decision rule will always lead to larger payoffs.
Create database objects to track the construction projects : You will use a database template to enter data into the Events table. You will create a simple query, a form, and a report.
The different theories of intelligence proposed : Provide a summary of the different theories of intelligence proposed in the textbook (Spearman, Sternberg, Gardner, and Salovey/Mayer's theories);Describe which theory you believe best describes intelligence;explain why you feel this way;Describe whe..
Locate the errors in the following code : Locate the errors in the following code

Reviews

Write a Review

JAVA Programming Questions & Answers

  Describe the basic c syntax for creating a class comprise

explain the basic c syntax for creating a class. include an explanation of the private and public section of a class

  Java programming murach 4th ed 1open the ch06ex1invoice

1.open the ch06ex1invoice project. take a screenshot after you open netbeans and paste it into a word or word

  Write a point class that represents points on an x y axis

write a point class that represents points on an x y axis. the data members should be doubles x and y plus an int value

  Create a virtual directory

Create a Web archive file and attach to this assignment. Do not copy (cut and paste) any example code, create your own code and use the examples as a guide.

  Create a project in eclipse

Create a new project

  Explain java-oriented microprocessors presented by sun

Research the latest Java-oriented microprocessors presented by Sun. In what ways are they optimized to implement Java programs?

  Write a java program

Create a "JApplet" that contains two parallel arrays with at least five friends' names and phone numbers. Allow the user to enter either a name or phone number and to click a "JButton" to display the other.

  Overriding the equals method

Use the equals method, which Player inherits from the Object class, to determine whether two players are the same. Are the results what you expect?

  Write a recursive method called maxsum

write a recrusive method called maxSum that accepts a list of integers. L, and an integer limit n as parameters and use backtracking to find the maximum sum that can be generated by adding elements of L that do not exceed n.

  Given a hash function hkey prepare a java simulation

given a hash function hkey prepare a java simulation program to determine each of the subsequent quantities after

  Create java application-input miles driven and gallons used

Create Java application which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display miles per gallon obtained for each tankful.

  Displays the calendar for the current month

Prepare a program that displays the calendar for the current month. You will use the Prior and next buttons to show the calendar of the previous or next month.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd