Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (1)

Powered by Vanilla. Made with Bootstrap.
[C++] Velocity calulator [basic]
  • Sh3llc0d3
    Posts: 1,910
    Hey guys well i'm learning C++ and thought since I was playing about with stuff and making little projects for myself i'd share them incase anyone else taking C++ up wanted some simple programs to learn from or whatever lol. I did create this, not great but i'm learning like I said :)

    /*
    This program is used to work out Velocity. Not a widely used equation, but in shooting
    and physics it's quite helpful.
    Created by Semtex-Primed
    */
    #include <iostream>
    int main()
    {
    //Variable declarations
    double vel; //Velocity
    double invel; //Initial Velocity
    double dist; //Distance
    double time; //Time

    std::cout << \"Semtex-Primed's Velocity calculator, this is based on the equation...\n\";
    std::cout << \"Velocity = Initial Velocity + (Distance x Time)\n\n\";
    /*
    initial velocity [if known] alot of people will not know what the
    initial velocity is. Hence entering 0 if it is not known.
    */
    std::cout << \"Enter 'Initial Velocity' if known [0 if not known]: \";
    std::cin >> invel;
    std::cout << \"\n\n\";

    //distance travelled
    std::cout << \"Enter distance projectile travelled: \";
    std::cin >> dist;
    std::cout << \"\n\n\";

    //time taken
    std::cout << \"Enter time taken: \";
    std::cin >> time;
    std::cout << \"\n\n\";

    //calculation area
    vel = invel + (dist * time);

    //Statement showing calulation and then answer
    std::cout << \"The following equation \" << invel << \" + ( \" << dist << \"*\" << time
    << \" ) equalls velocity of the projectile, which is: \" << vel;
    return 0;
    }


    Thanks guys and hope this helps some people :)
  • Xin
    Posts: 3,251
    Nice good luck learning it :) hope you get good
    Xin
  • Sh3llc0d3
    Posts: 1,910
    said:


    Nice good luck learning it :) hope you get good



    Hope I get good too, really need to get coding a hacking tool soon and give back to iExploit :P
  • Thanks for this i leraned something :)