- Joined
- Apr 14, 2012
- Messages
- 2,585
- Reaction score
- 0
- Points
- 36
Hey everybody,
Im continuing the painful saga of teaching myself C++, as mentioned in this thread here.
http://www.orbiter-forum.com/showthread.php?t=30866
To date, the only thing of vaguely substantial value Ive managed to produce has been Delta Vee!, a pretty basic calculator for calculating spacecraft delta vee given dry mass, propellant mass, & vexhaust, you all get the drill...
The program is pretty basic right now, but I plan on hopefully expanding it to have a visual interface, and a couple of nice little tools for planning Orbiter missions. I'll be posting updates in this thread, please enjoy!
Version 1.01
Im continuing the painful saga of teaching myself C++, as mentioned in this thread here.
http://www.orbiter-forum.com/showthread.php?t=30866
To date, the only thing of vaguely substantial value Ive managed to produce has been Delta Vee!, a pretty basic calculator for calculating spacecraft delta vee given dry mass, propellant mass, & vexhaust, you all get the drill...
The program is pretty basic right now, but I plan on hopefully expanding it to have a visual interface, and a couple of nice little tools for planning Orbiter missions. I'll be posting updates in this thread, please enjoy!
Version 1.01
Code:
// Delta Vee!
// A calculator for finding the total change in velocity of a spacecraft.
#include <iostream>
#include <math.h>
#include <string>
#define NEWLINE '\n'
#define TAB '\t'
using namespace std;
int main()
{
double DeeVee;
string Intro = "Delta Vee! 1.01 by John Lawson";
string Endofprogram = "Exiting Program";
string Endofcycle = "Continue or Exit?";
string meterspersecond = "m/s";
string hailprobe = "Hail the Probe!!!";
string text1 = "Exhaust Velocity (m/s):";
string text2 = "Dry Mass (kilograms):";
string text3 = "Propellant Mass:";
double Vexh;
double Mp;
double Md;
string punchout;
string postcycle;
string Continue = "Continue";
string Exit = "Exit";
string yes = "yes";
string Yes = "Yes";
string YES = "YES";
string YEs = "YEs";
string YeS = "YeS";
string yES = "yES";
string yeS = "yeS";
string yEs = "yEs";
string theory;
cout <<Intro;
computationstart:
cout <<NEWLINE;
cout <<text1;
cin >> Vexh;
cout <<text2;
cin >> Md;
cout <<text3;
cin >> Mp;
DeeVee = Vexh*(log((Mp+Md)/Md));
cout <<DeeVee;
cout <<TAB;
cout <<meterspersecond;
cout <<NEWLINE;
cout <<hailprobe;
cout <<NEWLINE;
cout <<Endofcycle;
decision:
cin >> postcycle;
{
if (postcycle == Exit)
{
goto endprogram;
}
if (postcycle == Continue)
{
goto computationstart;
}
else
{
goto decision;
}
}
endprogram:
cout <<NEWLINE;
cout <<Endofprogram;
return 0;
}