Identify and correct the errors in the following class declaration: class nifty { // data char personality[];
Question:
Identify and correct the errors in the following class declaration:
class nifty
{
// data
char personality[];
int talents;
// methods
nifty();
nifty(char * s);
ostream & operator<<(ostream & os, nifty & n);
}
nifty:nifty()
{
personality = NULL;
talents = 0;
}
nifty:nifty(char * s)
{
personality = new char [strlen(s)];
personality = s;
talents = 0;
}
ostream & nifty:operator<<(ostream & os, nifty & n)
{
os << n;
}
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (5 reviews)
The declaration of the constructor in line 4 has ...View the full answer
Answered By
James Warinda
Hi! I’m James Otieno and I'm an experienced professional online tutor with countless hours of success in tutoring many subjects in different disciplines. Specifically, I have handled general management and general business as a tutor in Chegg, Help in Homework and Trans tutor accounts.
I believe that my experience has made me the perfect tutor for students of all ages, so I'm confident I can help you too with finding the solution to your problems. In addition, my approach is compatible with most educational methods and philosophies which means it will be easy for you to find a way in which we can work on things together. In addition, my long experience in the educational field has allowed me to develop a unique approach that is both productive and enjoyable.
I have tutored in course hero for quite some time and was among the top tutors awarded having high helpful rates and reviews. In addition, I have also been lucky enough to be nominated a finalist for the 2nd annual course hero award and the best tutor of the month in may 2022.
I will make sure that any student of yours will have an amazing time at learning with me, because I really care about helping people achieve their goals so if you don't have any worries or concerns whatsoever you should place your trust on me and let me help you get every single thing that you're looking for and more.
In my experience, I have observed that students tend to reach their potential in academics very easily when they are tutored by someone who is extremely dedicated to their academic career not just as a businessman but as a human being in general.
I have successfully tutored many students from different grades and from all sorts of backgrounds, so I'm confident I can help anyone find the solution to their problems and achieve
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Identify and correct the errors in the following passages. Companys are finding it to their advantage to cultivate their suppliers. Partnerships between a company and its suppliers can yield hefty...
-
Identify and correct the errors in denotation or connotation in the following sentences: 1. In our group, we weeded out the best idea each person had thought of. 2. She is a prudent speculator. 3....
-
Identify and correct the errors in each of the following sets of code: a) while (c
-
John Woods' weekly gross earnings for the present week were $2,500. Woods has two exemptions. Using an $80 value for each exemption and the tax rate schedule below, what is Woods' federal income tax...
-
Suppose that an investment promises to pay a nominal 9.6 percent annual rate of interest. What is the effective annual interest rate on this investment assuming that interest is compounded (a)...
-
Seventy-one percent of U.S. adults think that political correctness is a problem in America today. You randomly select seven U.S. adults and ask them whether they think that political correctness is...
-
Refer to the information in QS 13-4. Use that information for Tide Corporation to determine the 2016 and 2017 common-size percents for cost of goods sold using net sales as the base. Data From QS...
-
In an attempt to judge and monitor the quality of instruction, the administration of Mega- Byte Academy devised an examination to test students on the basic concepts that all should have learned....
-
3. Market demand is given by: 100-Q, P(Q) = if Q <100 otherwise Suppose there are two firms both with constant marginal cost 50 and no fixed cost and capacity constraint. Assume that firms produce...
-
Sunray Electric Coop uses a fleet of 20 trucks to service its electric network. The company wants to develop a preventive maintenance schedule for the fleet. The probability of a breakdown in year 1...
-
Consider the following class declaration: class Golfer { private: char * fullname; // points to string containing golfer's name int games; // holds number of golf games played int * scores; // points...
-
What class methods does the compiler generate automatically if you dont provide them explicitly? Describe how these implicitly generated functions behave.
-
A $15 000, 2.5% bond is purchased six years and six months before maturity to yield 3% semi-annually. If the bond interest is payable semi-annually, what is the purchase price of the bond?
-
A borrower Is presented with a number of loan options on a $200,000 mortgage. The one with the lowest monthly payment is characterized as a "negative amortization" loan. What is the best describes...
-
Alan has identified a stock pattern showing a head-and-shoulders bottom formation and its price is breaking through the neckline. What investment decision is he likely to make?
-
Suppose they sell tickets for $100 per person and the catering company charges $25 per person in variable costs. How many tickets must the museum sell in order to break even? Not yet answeredPoints...
-
On October 1, Year 1 Shoe World received a $10,000, 120-day note from a customer. The note earns 10% interest per year. What is the amount recorded at December 31, Year 1, the company's year-end, and...
-
Explain how you would inspect stock for signs of pest damage, and say what you would be looking?
-
For the functions x = x(y, w), y = y(z, w), z = z(x, w), demonstrate that (x/y)w (y/z)w (z/x)w = 1.
-
The figure shows six containers, each of which is filled from the top. Assume that water is poured into the containers at a constant rate and each container is filled in 10 seconds. Assume also that...
-
Repeat Problem 9.10 for the function Data Form Problem 9.10 Find a hazard-free minimum-cost implementation of the function f (x,...,x5) = m(0, 4, 5, 24, 25, 29) + D(8, 13, 16, 21)
-
Find a hazard-free minimum-cost implementation of the function f(xx) = m(0, 4, 11, 13, 15) + D(2, 3, 5, 10)
-
Implement the FSM specified in Figure 9.39, using the merger diagram in Figure 9.40a. X1 X2 D D D a X4 (a) Circuit b d b- f
-
1. (10) Write the MATLAB statements required to plot sin x versus cos 2x from 0 to 2x in steps of /10. The points should be connected by a red line and each point should be marked with a blue...
-
3. (15 points) An organization is granted the block 130.56.0.0/16. The administrator wants to create 1024 subnets. Assume no IP address is reserved for special tasks. a. What is (are) the subnetmask...
-
1. Write structure of class A, B and C type of IP addresses and show how many hosts are theoretically possible for each network. Why practically 2 hosts are less than theoretical value? (3 marks) 2....
Study smarter with the SolutionInn App