1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Need C++ project ideas!

Discussion in 'Programming & Webmastering' started by Maelstrom, Jan 27, 2011.

  1. Maelstrom

    Joined:
    Sep 10, 2008
    Messages:
    534 (0.25/day)
    Thanks Received:
    159
    Location:
    VA/PA
    So I have to learn a little C++ for a freshman eng class, and in the future, with the degree I plan to go for, I imagine I'll have to learn a lot more C++. So I decided to go ahead a teach myself more than the class I'm currently in will (found a tutorial, and I can find more stuff online when the time comes). The issue is that I need ideas for programs to write so I can apply what I learn, and I cannot come up with any on my own. So TPU, what are some good C++ projects? Can be a wide array of difficulty, as I can tackle the harder ones in the future (I hope :p)
  2. Batou1986

    Batou1986

    Joined:
    Oct 2, 2005
    Messages:
    2,405 (0.75/day)
    Thanks Received:
    330
    Location:
    Baltimore MD
    its a shot in the dark but something to group edit media tags like on videos and pictures would be something useful.
    Maelstrom says thanks.
  3. hellrazor

    hellrazor

    Joined:
    Feb 18, 2010
    Messages:
    1,569 (0.97/day)
    Thanks Received:
    315
    Try to see if you can't make a program to draw a perfect circle, no matter what the resolution of the picture is.
    Maelstrom says thanks.
  4. Maelstrom

    Joined:
    Sep 10, 2008
    Messages:
    534 (0.25/day)
    Thanks Received:
    159
    Location:
    VA/PA
    Thanks guys for the quick responses. Keep 'em coming, even if the idea seems stupidly easy or hard.
  5. streetfighter 2

    streetfighter 2 New Member

    Joined:
    Jul 26, 2010
    Messages:
    1,658 (1.14/day)
    Thanks Received:
    732
    Location:
    Philly
    I'd start with data structures. Create a linked list and/or hash table using nothing more than pointers and basic variable types (so you can't #include <vector>). Being able to create your own data structures will help you when thinking about solving problems using programming.

    You can also do some work in algorithms. If you want something really basic try solving the knapsack problem by implementing the greedy algorithm in C++. For a slightly larger challenge you can try implementing Dijkstra's algorithm (but it may require a math background).

    Now if everything I've said up to this point is spitting in the wind then I'd suggest you try something incredibly fundamental:
    "You need to go to work every day, and you need to come back home every night. You have an umbrella, but you only bring it with you when it's raining. So if it rains in the morning and your umbrella is at your house then you will bring your umbrella to work; but if it doesn't rain in the evening you'll leave your umbrella at work. If I gave you the probability that it rains in the morning, lets call it M, and the probability that it rains in the evening, lets call it E, what's the probability that on any given day you'll be caught in the rain without your umbrella?

    Solve it by running a large simulation of several thousand (or more) days and keeping track of how many days you get caught in the rain without an umbrella.
    "

    If by some chance you've done everything I just said, then try writing multi-threaded programs: create your own multi-threaded merge-sort; solve the dining philosophers problem using semaphores; create a local chat client using shared memory or pipes

    BTW, most of the projects I mentioned were picked specifically because solutions to them in C++ are widely available. No one should be forced to learn without examples IMO :).
    Last edited: Jan 27, 2011
    Master, Maelstrom and Izliecies say thanks.
  6. matobinder New Member

    Joined:
    Jan 27, 2011
    Messages:
    4 (0.00/day)
    Thanks Received:
    3
    I'd vote to think data. Skip anything to do with a GUI/Graphics. All that is just bells and whistles.(but yes that can be where the money is...)

    Adding a GUI just complicates the matter. Your objective is to learn C++.

    With that said. You need something to muck with. If you don't have a GUI you need something tangible.

    This is where I thought a Data Systems class I took was helpful. Yes that was about 15 years ago, but the idea still holds the same and you will learn whatever language you are using...

    let me make up a problem. Lets go start with the cast of this movie.

    MachineX: This machine eats fig newtons.
    UserY : This machine is interested in how MachineX is doing.
    ProcessX: This program reads in data data about what MachineX is doing and passes it to UserY


    So your goal is to write ProcessX. What does our Manual about MachineX say?
    MachineX logs its metrics data to a local file called XYZ. It closes out this file once a day, and renames it abcdefg.date. The data in this file is continuous, and represents the following format.

    The first 16 bytes is the header:
    The next 256 bytes is the data:

    header is defined as
    {
    byte 0-7 time stamp
    byte 8-12 is IP address
    byte 13-15 is unused
    }

    data is defined as
    {
    byte 0-3 : Something ABC
    byte 4-7 : Something blah
    byte 8-15 : Something 16 bit...
    byte... you get the picture
    }

    ----
    So that was the end of our simple manual on what MachineX does.

    SO write ProcessX to read in these binary files, i.e first the header, then the data and repeat. Parse the info out. And then print a simple text report for UserY.

    Heck here, if you want a GUI, make your data logical that would fit into a nice plot. Spit it out into a CSV and load it into a spreadsheet.

    This makes sense to me. Hopefully more than just me. If you want to learn a language, first throw out anything thought of a GUI and focus on the basics. Data. Deal with data. Think about a GUI later.
  7. matobinder New Member

    Joined:
    Jan 27, 2011
    Messages:
    4 (0.00/day)
    Thanks Received:
    3
    Oh, I forgot my last part. Now the trick in all if this was in the details in the manual that I made up.

    "MachineX logs its metrics data to a local file called XYZ. It closes out this file once a day, and renames it abcdefg.date. The data in this file is continuous, and represents the following format."

    What this is telling you is that you are going to need to be reading data from a file in a certain directory. That file may be archive(moved) while you are reading it. It may grow in size. But there will always be a set of data in that directory. With a timestamped named on the file.

    The simplest thing you can do is tell your User that they will only get data over 24 hours old. That way you don't need to worry about MachineX renaming/moving the file on you. UserX won't like that. So now is where it gets tricky.

    The best part is this is all your own world. Start out with writing a simple MachineX that is really really nice. Don't have it do anything when you don't want it to.

    Write your app to read that data in.

    Now start making MachineX evil. Make sure your app can handle that data in a sane manner
    Maelstrom says thanks.
  8. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.09/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    ... and matrix transformation, vector mathematics, collision detection, artificial intelligencs, data structures, state machines, etc. I would hardly call it just "bells and whistles".

    But anyway, how about writing a program that will take a file and encrypt it and then compress it. A good exercise in several areas.
    parelem and Maelstrom say thanks.
  9. streetfighter 2

    streetfighter 2 New Member

    Joined:
    Jul 26, 2010
    Messages:
    1,658 (1.14/day)
    Thanks Received:
    732
    Location:
    Philly
    Having written a lot of programs doing rather complex matrix/vector calculations for engineering finance, I can tell you that you don't need a GUI ;). Also state machines, data structures, artificial intelligence, many physics/fluid simulations, statistics (matrices anyone? :laugh:) etc. (ad nauseam) can be done without any GUI whatsoever (but you'll probably want to plot the results later:D). I've never done collision detection (at least not that I'm aware of).
  10. Maelstrom

    Joined:
    Sep 10, 2008
    Messages:
    534 (0.25/day)
    Thanks Received:
    159
    Location:
    VA/PA
    Thanks ya'll. I did a bit of googling (googleing?) and found a good amount of project ideas as well. However, if you guys still have other ideas that might make a good project, don't hesitate to post it. I'm putting all the ideas in a word doc so I can I don't forget 'em ;)
  11. matobinder New Member

    Joined:
    Jan 27, 2011
    Messages:
    4 (0.00/day)
    Thanks Received:
    3
    Yes, I wanted to keep it simple... but complex enough to justify writing it in C/C++


    Something really neat to write, but does add the need to dig into whatever OS internals you are on. Is a simple tool to take a directory name, and tell you want files are in it. You can then go farther, and decide "hey if its a jpg I can tell you more" since that is a nice defined type to be able to parse as a 3rd party.

    But my basic statement still holds true I think. Don't worry about a big GUI presentation. Just have it be cout text. Try to deal with data. Whatever data you feel like. Just don't get caught up in the presentation of it.
    streetfighter 2 and Maelstrom say thanks.
  12. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.09/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    SF2, you are absolutely correct. But no one ever screamed "HEADSHOT" while running one of those programs. rofl

    @Mael ... You could always write a text only version of Tetris. :rockout:
    streetfighter 2 and Maelstrom say thanks.
  13. Maelstrom

    Joined:
    Sep 10, 2008
    Messages:
    534 (0.25/day)
    Thanks Received:
    159
    Location:
    VA/PA
    Lol that sounds awesome :roll:. If I do, I'm totally making it like the college humor video:
    Tetris God (watch it, it's funny)

    LINE PIECE!!!!!
  14. matobinder New Member

    Joined:
    Jan 27, 2011
    Messages:
    4 (0.00/day)
    Thanks Received:
    3
    Last edited: Jan 27, 2011
  15. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.09/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    One of my early coding endeavors was on my TI99/4A (16K RAM).
    I wrote a simple game where you were looking down a hallway at an intersection.
    Randomly a space ship would fly across the hallway for you to shoot at.
    It worked great until I wrote the collision detection, which ran it out of memory. :laugh:

    My advice is to not just pick random projects, but pick something that interests you.
    In my experience, the normal school projects are rather boring little exercises.

    It all depends upon your experience too.
    Many years ago a good friend of mine (I consider him a mentor) was working on a CS project for his Masters in CS and Electronic Engineering, and I asked him about the project.
    He shrugged and said, "We have to write a compiler parser. A quaint little exercise." :wtf:
    I look back now and realize that would be rather droll and tedious.
    Maelstrom says thanks.
  16. ctrain New Member

    Joined:
    Jan 12, 2010
    Messages:
    393 (0.24/day)
    Thanks Received:
    72
    I found it a lot of fun to get into graphics stuff. My first project was a simple 2d scrolling starfield effect. It's very simple once you think about it and it's fun to watch. Later you can branch into a simple 3d one is only a little more so since it's super simple to do the 3d transform if your view is centered in the world, no matrix or vector math needed.

    Basic drawing is simple to set up on Windows.
    Maelstrom says thanks.
  17. Maelstrom

    Joined:
    Sep 10, 2008
    Messages:
    534 (0.25/day)
    Thanks Received:
    159
    Location:
    VA/PA
    Thanks for all the ideas and advice guys, I really appreciated it! Oh and Kreij, while you are correct that the school projects are generally "boring", they can be hilariously fun when you know more than you should and add stuff that shouldn't be there (but that actually helps the program). Or at least, I found it fun xD
  18. Bot

    Bot

    Joined:
    Apr 14, 2009
    Messages:
    584 (0.30/day)
    Thanks Received:
    105
    how about a refrigerator inventory program that automatically creates a shopping list with re-order items. best of all, integrated barcode scanner.
    something is empty, scan it and it automatically gets taken off the inventory and added to the re-order list, which can then be printed out. :rockout:
    Maelstrom says thanks.
  19. Maelstrom

    Joined:
    Sep 10, 2008
    Messages:
    534 (0.25/day)
    Thanks Received:
    159
    Location:
    VA/PA
    That's actually a really cool idea, thx!
    Bot says thanks.
  20. codyjansen

    codyjansen

    Joined:
    Aug 26, 2009
    Messages:
    319 (0.18/day)
    Thanks Received:
    48
    that would be amazing.
  21. olithereal

    olithereal New Member

    Joined:
    May 24, 2008
    Messages:
    1,262 (0.56/day)
    Thanks Received:
    65
    Hey guys, just want do stop by and say that I've been looking at project ideas for C++ too, and that I have saved all of yours! It's good stuff, hoping to get on that soon, when I get some time!

    College semester just started so I don't have much time. Network Programming class and COBOL (fuck yeah!) class' exercises take a huge amount of time, so yeah. When I get more time I'll jump on these!
  22. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.09/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    I was thinking about this and it would really be pretty easy to code.

    Hmmm .. so did someone else. Looks like it took them about 10 hours to do it as an online app using Python and MySql.
    Grocist
    His does not appear to keep a running inventory list, though, just what to re-order. Still a cool idea.
  23. W1zzard

    W1zzard Administrator Staff Member

    Joined:
    May 14, 2004
    Messages:
    14,639 (3.93/day)
    Thanks Received:
    11,375
    make that an iphone/android app using the integrated camera that creates the shopping list for you on the device
  24. Bot

    Bot

    Joined:
    Apr 14, 2009
    Messages:
    584 (0.30/day)
    Thanks Received:
    105
    thanks, that is pretty .. RSS feed for a grocery list? nice
  25. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.09/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    Have you picked a project, Mael? If so what are you working on?
    Inquiring minds want to know !! lol

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page