I'm having problems with my DisplayEntry function. What this program is supposed to do it display numbers that have been validated earlier in the program. The problem is it is displaying random numbers stored in the computer. I'm gonna include the struct declarations, the function call, and the actual function.
struct SourceType
{
float latitude;
float longtiude;
};
struct TravelType
{
float time;
float distance;
float altitude;
};
struct TargetType
{
float latitude;
float longitude;
};
struct ProjectileData
{
float speed;
float azimuthal;
float equatorial;
SourceType source;
TravelType travel;
TargetType target;
};
DisplayEntry(data);
void DisplayEntry(ProjectileData data)
{
cout << "\nThe Projectile is Launched With a Speed of: " << data.speed << endl;
cout << "with an Azimuthal Angle of: " << (data.azimuthal) << endl;
cout << "and an Equatorial Angle of: " << (data.equatorial) << endl;
cout << "travels a Time of: " << ((2.0 * (data.speed) * (sin(data.azimuthal))) / (9.81)) << endl;
cout << "over a Distance of: " << ((data.speed) * (cos(data.azimuthal)) * (data.travel.time)) << endl;
cout << "reaches and Altitude of: " << ((9.81 * (data.travel.time) * (data.travel.time)) / (2.0)) << endl;
cout << "departs from Coordinates: " << ((data.source.latitude) + (data.travel.distance) * (sin(data.equatorial))) << endl;
cout << "and Arrives at Coordinates: " << ((data.source.longtiude) + (data.travel.distance) * (cos(data.equatorial))) << endl;
}