another should report the serial number and position.
Coding
#include<iostream>
using namespace std;
class ship{
private:
int serial;
static int num;
int degrees;
float minutes;
char direction;
public:
ship()
{
num++;
serial = num;
}
void getLoc()
{
cout << “Enter Degrees: “; cin >> degrees;
cout << “Enter Minutes: “; cin >> minutes;
cout << “Enter Direction: “; cin >> direction;
}
void reportSerLoc()
{
cout << “Ship Number ” << serial << ” Is At ” << degrees << ‘\xF8’ << minutes << “\'” << direction << endl;
}
};
int ship::num=0;int main()
{
ship s1,s2,s3;
cout << “Enter Location Of 1st Ship” << endl;
s1.getLoc();
cout << “Enter Location Of 2nd Ship” << endl;
s2.getLoc();
cout << “Enter Location Of 3rd Ship” << endl;
s3.getLoc();
s1.reportSerLoc();
s2.reportSerLoc();
s3.reportSerLoc();
}