Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Satellite Geolocation Diagram #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions code_task/class_diagram_implementation_gkkp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// GROUP MEMBER ID's:
// 1115 2020 00032
// 1115 2020 00083
// 1115 2020 00084
// 1115 2022 00151


#include <iostream>

using namespace std;

class Satellite
{
private:
long Longtitude;
long Latitude;
long Altitude;
int HeatLevel;

public:
// CONSTRUCTOR
Satellite(long Longtitude, long Latitude, long Altitude)
{
this->Longtitude = Longtitude;
this->Latitude = Latitude;
this->Altitude = Altitude;
}

// SETTERS

void setLongtitude(long Longtitude)
{
this->Longtitude = Longtitude;
}

void setLatitude(long Latitude)
{
this->Latitude = Latitude;
}

void setAltitude(long Altitude)
{
this->Altitude = Altitude;
}

void setHeatLevel(int HeatLevel)
{
this->HeatLevel = HeatLevel;
}

// GETTERS

long getLongtitude(void)
{
return this->Longtitude;
}

long getLatitude(void)
{
return this->Latitude;
}

long getAltitude(void)
{
return this->Altitude;
}

int getHeatLevel(void)
{
return this->HeatLevel;
}
};

class FireScanner
{
public:
void ScanLocationForFire(Satellite *S)
{
if(S->getHeatLevel() >= 100)
{
cout << "Fire detected at: " << S->getLongtitude() << " " << S->getLatitude() << " " << S->getAltitude() << endl;
cout << "The Heat level is: " << S->getHeatLevel() << endl;
}

return;
}
};

class Drone
{
private:
FireScanner FS;
long Longtitude;
long Latitude;
long Altitude;

public:
// CONSTRUCTOR
Drone(long Longtitude, long Latitude, long Altitude)
{
this->Longtitude = Longtitude;
this->Latitude = Latitude;
this->Altitude = Altitude;
}

void ScanLocationForFire(Satellite *S)
{
FS.ScanLocationForFire(S);
}

};


int main(void)
{
// Create a Satellite object
Satellite sat1(12345, 67890, 10000);

// Create a Drone object
Drone drone(54321, 98765, 5000);

// Set the heat level of the satellite
sat1.setHeatLevel(150);

// Scan the location for fire using the drone
drone.ScanLocationForFire(&sat1);

return 0;
}