ATTENTION: All programmers/coders/etc.

Discussion in 'Computers and Technology' started by Fruscainte, Sep 29, 2009.

ATTENTION: All programmers/coders/etc.

Discussion in 'Computers and Technology' started by Fruscainte, Sep 29, 2009.

  1. Fruscainte

    Fruscainte New Member

    Joined:
    Sep 28, 2009
    Messages:
    80
    Likes received:
    0
    Trophy points:
    0
    From:
    Florida
    I'm interested in learning to code, specifically C++ as a most obvious way. I get the essentials of this, read a few books and articles online. I've minorly coded before; but nothing much or helpful. Would anyone mind giving me some good sources to begin actually jumpstarting my way into C++ coding and perhaps some minor Algorithims?

    I plan on going to College for Computer Science Engineering (or something akin to such) and I'd first of all like to get a headstart on the competition, and get a new hobby that interests me. So please, if anyone can know ^_^
     
  2. jasmine

    jasmine New Member

    Joined:
    Feb 26, 2009
    Messages:
    506
    Likes received:
    5
    Trophy points:
    0
    From:
    England
    Invent your own algorithms. That's what programming is.

    Try these. Report when you've done them:

    1. print your name on screen.

    2. input two numbers A and B. Multiply them together and print the result as text in a formatted string such as "3 multiplied by 5 equals 15"

    3. Input a number A. Calculate the sum of all whole numbers from 1 to A inclusive. Print the result on screen.

    4. input a number X. Test if X is divisible by 7, and print the result on screen as text, such as "210 is divisible by 7."

    5. Input a number X. Test if X is prime by seeing if it is divisible by all numbers from 2 upto X-1. Report the result as text in a formatted string such as "31 is prime."

    6. Extend program 5. Instead of X, now input a number Y. Automatically test all numbers from 2 upwards until you find the Y'th prime number. Print the Y'th prime number.

    7. Create an array called Primes[ ] . Populate it with the primes, such that the Y'th entry is the Y'th prime number, upto Y=1000. Create another array called Products[ ], of long integers. Consider all pairs A and B, such that A is not equal to B, no less than 1 and no greater than 1000. Multiply the A'th prime with the B'th prime and insert the result into the next vacant slot in Products array. You will need to create a counter which steps forward through the Products array. Finally, add up all the entries in the products array and print the answer.

    8. Run through the products array comparing adjacent pairs, and if the lower number us bigger than the upper number, then swap them. Keep running through the array until you can no longer swap any more. The numbers will have been sorted from smallest to biggest. This is called a Bubble-Sort. So now print out the smallest 100 elements in the array.
     
  3. Ste

    Ste New Member

    Joined:
    Dec 26, 2008
    Messages:
    585
    Likes received:
    1
    Trophy points:
    0
    From:
    Chicago
    Don't forgot to include loops and decision statements in those as well.

    heres a site for C++ for a college course no password or user name required.
    http://www.cs.niu.edu/~abyrnes/csci240/

    Also heres a free compiler
    http://www.bloodshed.net/devcpp.html

    And heres a basic set of source code to get ya started:

    //Begin code

    #include <iostream>

    #include <iomanip>

    using namespace std;

    int main()

    {

    //Your code here

    system("pause");

    return 0;

    }

    //end code
     
    Last edited: Sep 29, 2009
  4. 10-Neon

    10-Neon New Member

    Joined:
    May 23, 2007
    Messages:
    1,713
    Likes received:
    4
    Trophy points:
    0
    From:
    Gainesville, FL
    Jasmine's exercises look a lot like what might be assigned in the first month of an intro programming class. Definitely relevant practice.
     
  5. Ste

    Ste New Member

    Joined:
    Dec 26, 2008
    Messages:
    585
    Likes received:
    1
    Trophy points:
    0
    From:
    Chicago
    theres also programs on the website i linked.
     
  6. Fenix

    Fenix Moderator

    Joined:
    May 21, 2007
    Messages:
    6,769
    Likes received:
    11
    Trophy points:
    0
    I personally know nothing, but here's two good links (1st better than second).

    Link 1

    Link 2

    The first one is a list of lessons and such by an awesome guy. The second is less organized, but is posted by someone much like you. There's some good links in that thread.
     
  7. Ste

    Ste New Member

    Joined:
    Dec 26, 2008
    Messages:
    585
    Likes received:
    1
    Trophy points:
    0
    From:
    Chicago
    The ironic thing is that Im pretty good at C++ programming, but I don't like doing it..
    especially when the output has to be formated EXACTLY in a specific way.

    Blah...