| View previous topic :: View next topic |
| Author |
Message |
Losplagos Expert Cheater
Reputation: 0
Joined: 21 Mar 2006 Posts: 172 Location: Knee deep in a c++ book
|
Posted: Sat Aug 25, 2007 3:43 am Post subject: Looking for c++ learning resources |
|
|
I am looking for c++ learning resources that assume that this is your first programing langauge and you have little to no experience programing.
I might buy a book or two if it is reviewed good enough for what i whant.
Also i would like a good reference guide.
Perferably any bought materials should be amazon.com links.
Im currently using functions and the extent of my programing skill is this. code:
| Code: | # include <iostream>
# include <cmath>
double Radians(double);
int quitMessage();
int main ()
{
double Answer,Power, Gravity; //This Loop gets all the variables and checks them
int D;
int Z;
std::cout << "If you input a number that is not postive"
<<std::endl
<<"or over 400 for the power the " // explaining the rules
<<"program will not work Enter 0 to exit."
<<std::endl
<<"Also entering a number with a letter or a letter will close the program";
for (;;)
{
std::cout << "Angle?: ";
std::cin >> Answer; // The next comment full of code i need to improve any ideas?
if(Answer==0)
return quitMessage(); // Returns EXIT_SUCCESS;
Answer = Radians (Answer);
std::cout
<< "Power in pixels up too 400?"
<<std::endl;
std::cin >> Power;
if(Power==0)
return quitMessage(); // Returns EXIT_SUCCESS;
std::cout
<< "Gravity of the shot"
<<std::endl;
std::cin >> Gravity;
if(Gravity==0)
return quitMessage(); // Returns EXIT_SUCCESS;
Answer = pow(Power,2)*(sin (2 * Answer) / Gravity); // The formula*
std::cout
<< "Shot distance traveled is: "
<< Answer
<< std::endl<<std::endl;
}
return EXIT_SUCCESS;
}
double Radians (double A)// This function calculates The angle
{
const double Pi = 3.14159;
double R;
R = (A*2/Pi);
return R;
}
int quitMessage(){
std::cout << "Yawns!" << std::endl;
return EXIT_SUCCESS;}
|
And that is thanks alot too jani for helping me learn that much.
_________________
Earthbound = 31337 |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Aug 25, 2007 9:18 am Post subject: |
|
|
Go buy Sams Teach Yourself C++ in 21 Days. Then after your done with that go to http://winprog.org/tutorial/ to learn about win32 applications in C++. Then if you want, you can go here, on how to learn to make games with DirectX. http://www.directxtutorial.com/Tutorial9/tut
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Losplagos Expert Cheater
Reputation: 0
Joined: 21 Mar 2006 Posts: 172 Location: Knee deep in a c++ book
|
Posted: Sat Aug 25, 2007 9:40 am Post subject: |
|
|
Thanks i will keep that in mind anyone else got any suggestions?
_________________
Earthbound = 31337 |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Aug 25, 2007 2:58 pm Post subject: |
|
|
| C++ Primer Plus is a better book.
|
|
| Back to top |
|
 |
|