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: 88% (9 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)...
-
Suppose that you hear a clap of thunder 16.2 s after seeing the associated lightning stroke. The speed of sound waves in air is 343 m/s, and the speed of light is 3.00 X 108 m/s. How far are you from...
-
Identify at least three grounds for an involuntary dismissal of an action.
-
Jones, having filed locally an affidavit required under the assumed name statute, has been operating and advertising his exclusive toy store for twenty years in Centerville, Illinois. His advertising...
-
Select a medical sales company or pharmaceutical company that is publicly traded. Complete a financial analysis of this company based on the publicly available financial information for the company....
-
What discount rate is the Powerball lottery company using when deciding to pay a lump sum of $327.8m to each of the 3 winning ticket holders?
-
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.
-
Because Earth rotates once every 24 hours, the west wall in your room moves in a direction toward you at a linear speed that is probably more than 1000 kilometers per hour (the exact speed depends on...
-
Santa Rosa Corporation is a closely held furniture manufacturing company employing approximately one thousand employees. On December 15, the corporation retained the firm of Warren and Wood,...
-
Describe some ways that diversity in the workforce can help an organization.
-
David Anderson, CPA, is engaged in the audit of the financial statements of Redondo Manufacturing Corporation for the year ended June 30, 200X. Redondo's inventories at year-end include finished...
-
Define concept growth. What does this mean to entrepreneurial firms?
-
Is the use of AI technology for work automation ethical? Why or why not?
-
Describe and explain the difficulties involved in grinding parts made of (a) Thermoplastics, (b) Thermosets, (c) Ceramics?
-
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
-
Use the following information for the Problems below: The following data pertain to three divisions of Nevada Aggregates, Incorporated. The company's required rate of return on invested capital is 8...
-
You are a database security professional working for an online retail clothing chain. Orders may be placed in two ways: Customer entry on your website Employee entry based on a phone call from the...
-
The fact-finding techniques discussion : Although most situations may allow use of all the techniques, which "two or three" techniques would you choose to begin collecting information to improve a...
Study smarter with the SolutionInn App