Follow us on Twitter!
I'd prefer to die standing, than to live on my knees - Che Guevara
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 18
Guests Online: 16
Members Online: 2

Registered Members: 82906
Newest Member: ilija
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Need help fast C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-10-06 05:00
This is solving motion of physics... and for the intal speed i cant use 0 and i need to be able to.. i need to know how i can use a NULL so it solves for infomation that is not there. i used 0 not think but i cant figure it out.....ty for ur time



Code
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
string physicsnow(double v,double t,double d,double a,double dv)
{
     cout <<"\n\n\n";
     cout <<"~~Thinking cause ur to lazy to~~" << "\n\n";
       
       int null=0; // use 0 as a variable.
             
       if(v==null) // speed
       {
        v=d/t;   
           }
       if(t==null) // time
       {
        t=d/v;   
           }
       if(d==null) //distance
       {
        d=t*v;   
           }
       if(a==null) //acceleration
       {
        a=dv/t;   
           }
       if(dv==null) //detlav
       {
        dv=a*t;   
           }
     cout <<"The Avg speed is: "<< v <<"m/s"<< "\n\n";
     cout <<"The Time is: " << t << "s" << "\n\n";           
     cout <<"The Distance is: " << d << "m" << "\n\n";
     cout <<"The Acceleration is: "<< a << "m/s sqr" << "\n\n";
     cout << "The Change in Speed is: " <<dv<< "m/s" << "\n\n";             
}
int main(int argc, char *argv[])
{
    cout << "\n" << endl;
    cout << "Thank your For using Motion Physics Calculator By ::zer0pain::"<< "\n" << endl;
    cout << "To report any bugs plz feel free to email me at zer0.crashoveride@gmail.com" <<"\n"<< endl;
   
    double v, t, d, a, vi, vf, dv ;
   
    cout << "Directions:" << "\n" ;
    cout << "For any varibles that u are solving for you must put '0'" << "\n" << endl;
   
    cout <<"Please input speed in meters/second:" ;
    cin >> v;
   
    cout <<"Please input distance in meters:" ;
    cin >> d;
   
    cout <<"Please input time in seconds:" ;
    cin >> t;
   
    cout <<"Please input accerlation in m/s sqr:" ;
    cin >> a;
   
    cout <<"Please input intal speed in m/s:" ;
    cin >> vi;
   
    cout <<"Please input final speed in m/s:" ;
    cin >> vf;
   
    dv=vf-vi;
   
    physicsnow(v, t, d, a, dv);
   
    system("PAUSE");
    return EXIT_SUCCESS;
}






Author

RE: Need help fast C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-10-06 05:15
I know absolutely nothing about physics but... I tested your program and it worked fine for me. What was your output when you tried to use 0 as your initial speed? This is what I got when I used your program. Everything seems good.

Code


Thank your For using Motion Physics Calculator By ::zer0pain::

To report any bugs plz feel free to email me at zer0.crashoveride@gmail.com

Directions:
For any varibles that u are solving for you must put '0'

Please input speed in meters/second:30
Please input distance in meters:500
Please input time in seconds:20
Please input accerlation in m/s sqr:12
Please input intal speed in m/s:0
Please input final speed in m/s:10



~~Thinking cause ur to lazy to~~

The Avg speed is: 30m/s

The Time is: 20s

The Distance is: 500m

The Acceleration is: 12m/s sqr

The Change in Speed is: 10m/s

Press any key to continue . . .




Author

RE: Need help fast C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-10-06 05:23
see u solved for vi i need to have vi ans a value of 0 like the car starts at 0 and accelerats to 60km/h


Author

RE: Need help fast C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-10-06 05:23
I also found that instead of using your int defined null variable, you could use NULL and everything appears to work fine. Just less work for you.
Author

RE: Need help fast C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-10-06 05:27
zer0pain1337 wrote:
see u solved for vi i need to have vi ans a value of 0 like the car starts at 0 and accelerats to 60km/h


Can you give me a case in which it doesn't work? Give me the variable's you had when it didn't work.

Edited by on 05-10-06 05:32
Author

RE: Need help fast C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-10-06 05:40
o i think i got it. the way i set it up i kinda fixes its self cause each if has can set a var. and it solves for vi every time cause u put 0. if u dont have the info to solve for it so leave the last 3 as 0's



Author

RE: Need help fast C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-10-06 05:42
omg it solves it every time i cant thing of var that wont solve 4 it so in a way that is good but... i want the user to be able to put in nulls and not using int values. since im dealing with #s ya know...