Floor66
2009-11-19 08:59:19
I've been learning C++ and needed something to easen up my homework, so I wrote this! Filling in letters instead of numbers will crash it (on my todo list to fix that).
I now announce: PythagorasV2! No GUI, console does the job just fine.
What does it do? It finds you the unknown side in a triangle, using Pythagoras' theorem! It doesn't only apply "sqrt(a*a + b*b)" (for finding the hypotenuse), it also applies to finding the other sides of a triangle.
Download link (also includes the source): http://rapidshare.com/files/308773441/PythagorasV2.rar
Link 2: http://specs.thamob.nl/PythagorasV2.rar
If you have comments, ideas, ways to shorten certain pieces of code, etc. don't hesitate to reply!
Scan: http://virusscan.jotti.org/en/scanresult/3184bb73ddf594f1a7cc3fbd712bc9e2ff0163fa
EDIT:
Need some help; how would I do this properly?
[php]
string s[2];
double d[2];
int main()
{
d[0] = 3.0;
d[1] = 4.0;
s[0] = "First sentence: " << d[0];
s[1] = "Second sentence: " << d[1];
cout << s[0] << endl;
cout << s[1] << endl;
cout << endl;
system("PAUSE");
return 0;
}
[/php]
Because this will return:
I now announce: PythagorasV2! No GUI, console does the job just fine.
What does it do? It finds you the unknown side in a triangle, using Pythagoras' theorem! It doesn't only apply "sqrt(a*a + b*b)" (for finding the hypotenuse), it also applies to finding the other sides of a triangle.
Download link (also includes the source): http://rapidshare.com/files/308773441/PythagorasV2.rar
Link 2: http://specs.thamob.nl/PythagorasV2.rar
If you have comments, ideas, ways to shorten certain pieces of code, etc. don't hesitate to reply!
Scan: http://virusscan.jotti.org/en/scanresult/3184bb73ddf594f1a7cc3fbd712bc9e2ff0163fa
EDIT:
Need some help; how would I do this properly?
[php]
string s[2];
double d[2];
int main()
{
d[0] = 3.0;
d[1] = 4.0;
s[0] = "First sentence: " << d[0];
s[1] = "Second sentence: " << d[1];
cout << s[0] << endl;
cout << s[1] << endl;
cout << endl;
system("PAUSE");
return 0;
}
[/php]
Because this will return:
1>c:\documents and settings\den hartog\mijn documenten\visual studio 2008\projects\tests\tests\main.cpp(13) : error C2296: '<<' : illegal, left operand has type 'const char [17]'
1>c:\documents and settings\den hartog\mijn documenten\visual studio 2008\projects\tests\tests\main.cpp(13) : error C2297: '<<' : illegal, right operand has type 'double'
1>c:\documents and settings\den hartog\mijn documenten\visual studio 2008\projects\tests\tests\main.cpp(14) : error C2296: '<<' : illegal, left operand has type 'const char [18]'
1>c:\documents and settings\den hartog\mijn documenten\visual studio 2008\projects\tests\tests\main.cpp(14) : error C2297: '<<' : illegal, right operand has type 'double'