Question: class Body { }; int main() { // name mass(kg) x y z radius (m) Body earth(earth, 5.972e24, 0,0,0, 6.371e6); Body moon(moon, 7.34767309e22, 384.400e6,0,0, 1.737e6);

class Body {
};
int main() {
// name mass(kg) x y z radius (m)
Body earth("earth", 5.972e24, 0,0,0, 6.371e6);
Body moon("moon", 7.34767309e22, 384.400e6,0,0, 1.737e6);
cout << earth << ' ';
cout << moon << ' ';
}

1.

Do not edit the main() function in any way. 

2.

Create a Body class in the same .cc file as main() that allows the program to compile and function properly. Pay special attention to the included comments in main() that explain how to implement the Complex class.

3, << friend

Example output

earth 5.972e24 0 0 0 6.371e6 moon 7.34767309e22 384.400e6 0 0 1.737e6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!