Problem

Find the Errors Each of the following declarations, programs, and program segment...

Find the Errors

Each of the following declarations, programs, and program segments has errors. Locate as many as you can.

A) class Circle:

{

private

double centerX;

double centerY;

double radius;

public

setCenter(double, double);

setRadius(double);

}

B) #include

using namespace std;

Class Moon;

{

Private;

double earthWeight;

double moonWeight;

Public;

moonWeight(double ew);// Constructor

{ earthWeight = ew; moonWeight = earthWeight / 6; }

double getMoonWeight();

{ return moonWeight; }

}

int main()

{

double earth;

cout >> "What is your weight? ";

cin << earth;

Moon lunar(earth);

cout << "On the moon you would weigh "

<

return 0;

}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT