Describe the order of function execution for baseconstructor

Assignment Help Basic Computer Science
Reference no: EM131038384

1. What must happen to allow private members of a class to be inherited by a derived class?

2. Describe the order of function execution for base and derived constructor functions and for destructor functions.

3. If the overloaded constructor is used when constructing a child class object, but the child's constructor doesn't explicitly call the parent's overloaded constructor, which, if any parent constructor is called?

4. Write a program that sets up a base class Sailor containing protected data for name, rank, and serial number. There should be two constructor functions: one is empty and the other has the three data values as inputs. The other member functions should include a GetInfo function (asks the user for Sailor information) as well as a WriteInfo (writes all the Sailor data to the screen).

Next derive a new class from Sailor. The Sailor_At_Sea class has the name of the ship to which the Sailor has been assigned, as well as the name of the ship's home port. The Sailor_At_Sea class also has two constructor functions: one that does nothing and the other that receives all the possible Sailor data. This derived class constructor passes the sailor data to the base class constructor. There are also WriteInfoand GetInfo functions that call the associated Sailor functions before handling the derived class specific data.

The main function has several steps.

1. Initially it should declare one Sailor and one Sailor_At_Seaobjects. Simply make up all the data and pass it into the objects when they are created.

2. Call the WriteInfo functions and verify that the objects were created with the data you passed into them.

3. Next, change the information in both objects by calling the GetInfo functions, and then call the WriteInfofunctionto verify that the object data has been changed.

Reference no: EM131038384

Questions Cloud

How the us food system influences mental health of children : Write an initial post that explains how the "US food system" influences the mental and physical health of children, making sure to discuss specific factors presented in the film the location of those factors in the bioecological model.
Determining the standard time : If in a time study, the observed time is 0.75 min, rating factor = 110% and allowances are 20% of normal time, then what is the standard time?
Write the corresponding loglinear model : Write the corresponding loglinear model. b. Which, if any, pairs of variables are conditionally independent? If Y is a binary response, what is the corresponding logistic model?
Analysis case-making cookies : You and your roommate are preparing to launch a small business in your on-campus apartment. You plan to provide fresh cookies to hungry students at night. Your cookie is different from store bought cookies because they are freshly baked and your c..
Describe the order of function execution for baseconstructor : Next, change the information in both objects by calling the GetInfo functions, and then call the WriteInfofunctionto verify that the object data has been changed.
Examine the influence of a television program : In a fictional study, a pretest-posttest design was used to examine the influence of a television program on children's aggressiveness. The number of aggressive responses was measured during an observation period both before and after the televisi..
A logistic model more appropriate : For a multiway contingency table, when is a logistic model more appropriate than a loglinear model, and when is a loglinear model more appropriate?
For the maine accident data modeled : For the Maine accident data modeled in Section 7.3.2: a. Verify that logistic model (7.9) follows from loglinear model (GLS, GI, LI, IS). b. Show that the conditional log odds ratio for the effect of S on I equals model
Do resources and capability analysis value chain analysis : Do the resources and capability analysis, value chain analysis

Reviews

Write a Review

Basic Computer Science Questions & Answers

  The beginning of the description of the function

From the same code you provided me with, can you complete the following: Use pseudocoding and (optionally) flowcharting to describe the flow of the main program. If there are functions that support the main flow describe separately in sub sections of..

  Explain can capabilities protect against all trojan horses

Can capabilities protect against all Trojan horses? Either show that they can or describe a Trojan horse process that C-Lists cannot protect against.

  Create a budget for a church with an appealing format that w

Using Excel, create a budget for a church with an appealing format that will identify the income/expenses of the church. This can be a yearly budget or a monthly budget (or both). Include relevant categories, formulas, and appropriate formatting choi..

  Develop app that reads a qr code

An app that reads a QR code with a student ID in it and saves that into a variable, and can make and display a QR code from a string variable.

  Determine the tensions and developed in the tape

If the coefficient of static friction between the tape and the drive wheel and between the tape and the fixed shafts A and C is µs = 0.1 , determine the tensions and developed in the tape for equilibrium.

  Discuss how server virtualization

From the e-Activity, discuss how server virtualization, architecture, and Hyper-V can create advantages and efficiencies for an enterprise, including considerations for how to decide what an enterprise should factor in when calculating Return on Inve..

  Write a program that translates a number

Write a program (called Grades) that translates a number between 0 and 4 into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better g..

  List three debugging methods within the debugger which can

list three debugging techniques within the debugger that can be used to locate logical error in the java code. for each

  Explaining slash dotted and flash crowd

What do terms slash dotted and flash crowd signify to?

  Use an open-addressed hashing table of size m

1)Suppose that we use an open-addressed hashing table of size m to store n ? m / 2 items. Assuming uniform hashing, show that for i = 1, 2, ..., n, the probability is at most 2?k that the i-th insertion requires strictly more than k probes.

  System information requirement investigation techniques

Approach to Systems Development. Compare the use of SDLC and agile development approaches.

  Solve decanting problem using euclidean algorithm

Use Euclidean algorithm to solve decanting problem for decanters of sizes 1317 and 1075. Or we can say, determine integers x and y.

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