Concept explainers
#include <iostream>
using namespace std;
Class Moon;
{
Private;
double earthWeight;
double moonWeight;
Public;
moonWeight(double ew);
{ earthWeight = ew; moonWeight = earthWeight / 6; }
double getMoonWeight();
{ return moonWeight; }
}
int main()
{
double earth;
cout ≫ "What is your weight?”;
cin ≪ earth;
Moon 1unar(earth);
cout ≪ "On the moon you would weigh "
≪lunar.getMoonWeight() ≪ endl;
return 0;
}
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
EBK STARTING OUT WITH C++
Additional Engineering Textbook Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Degarmo's Materials And Processes In Manufacturing
Electric Circuits. (11th Edition)
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)