command-line Ideas for a newbie c++ programmer?

D

Dave

I recently started to learn C++, i have a rough idea on most things in
the language and my knowlage is slowly expanding. The problem is, I'm
getting "artist-block", I cannot think of anything to code for
practice, i've been doing couts and cins such as, enter a
number...blah blah...but that isn't really a challenge anymore, i can
code that with my eyes closed i've done it that many times! I'm only
able to do command-line sort of apps because I'm still learning! :p
Any Suggestions?

Thanks for any help

*no flaming please, I don't like abuse, my self-esteam is low enough
as it is* :p
 
S

Sharad Kala

Dave said:
I recently started to learn C++, i have a rough idea on most things in
the language and my knowlage is slowly expanding. The problem is, I'm
getting "artist-block", I cannot think of anything to code for
practice, i've been doing couts and cins such as, enter a
number...blah blah...but that isn't really a challenge anymore, i can
code that with my eyes closed i've done it that many times! I'm only
able to do command-line sort of apps because I'm still learning! :p
Any Suggestions?

- If you just have a rough idea on most of the things then first get a good
C++ textbook. Recommendations - Accelared C++ (Koening &Moo), You Can Do It!
(Francis Glassborow), C++ Primer (Lippman/Lajoie). Check more book
recommendations at http://www.accu.org
- Try to solve the exercises at the end of each chapter.

HTH,
Sharad
 
R

Rolf Magnus

Dave said:
I recently started to learn C++, i have a rough idea on most things in
the language and my knowlage is slowly expanding. The problem is, I'm
getting "artist-block", I cannot think of anything to code for
practice, i've been doing couts and cins such as, enter a
number...blah blah...but that isn't really a challenge anymore, i can
code that with my eyes closed i've done it that many times! I'm only
able to do command-line sort of apps because I'm still learning! :p
Any Suggestions?

How about making a calculator? Write a parser that can parse mathemetical
expressions like 3 * (2 + 5) / 16.7 and calculate the result. You can add a
stack to that calculator so that older results can be used in new
calculations, and you can make it support variables for storing values.
Surely, you can think of more features to add.
 
S

Sinatra

I'll do that, thanks very much.
Going to need to slap some cash together first :p
In the mean time, can anyone suggest any exercises that they've done in the
past? :)
 
G

Gernot Frisch

Dave said:
I recently started to learn C++, i have a rough idea on most things
in
the language and my knowlage is slowly expanding. The problem is,
I'm
getting "artist-block", I cannot think of anything to code for
practice, i've been doing couts and cins such as, enter a
number...blah blah...but that isn't really a challenge anymore, i
can
code that with my eyes closed i've done it that many times! I'm
only
able to do command-line sort of apps because I'm still learning! :p
Any Suggestions?

Thanks for any help

*no flaming please, I don't like abuse, my self-esteam is low enough
as it is* :p

For beginners a common task would be to write a simple data base for
your CD-collection. With a search function and so on...
Or write a programm that inputs some data and creates a html file from
it.
Or even better: make a directory, where you have a lot of .html files.
Each file has some "###NAME###", and "###TITLE###" texts. Now, have
the user provide such a file (argv) and parse it, make a list of all
the ###xx### arrays and ask for substitutions, then substitute them,
write the file to disk and open it in a webbrowser (command "system").
This way you can design template greeting cards, invitations etc..

-Gernot
 
P

Pedro Graca

Dave said:
I recently started to learn C++ ...
I cannot think of anything to code for practice ...
I'm only able to do command-line sort of apps because I'm still learning!
Any Suggestions?


Try this:

You have two files with names (one per line).
Identify which names are in only one file and which are in both files.

eg file1
Pedro Graca
Dave
Anonymous

eg file2
Anonymous
NoName

eg result:
names only in file1:
Pedro Graca
Dave

names only in file2:
NoName

names in both files:
Anonymous


Happy Coding :)
 
S

Sinatra

thanks for the suggestions guys, really appreciate it.
i'm still having a go at that calculator :p
getting a syntax error during compilation though.
just trying to figure out where i went wrong :D
 
A

Andrey Butov

topcoder.com has a wide plethora of practice examples for you to use.

It will even test your code for correctness and give you the answers of
hundreds of other folks
 
R

rossum

I recently started to learn C++, i have a rough idea on most things in
the language and my knowlage is slowly expanding. The problem is, I'm
getting "artist-block", I cannot think of anything to code for
practice, i've been doing couts and cins such as, enter a
number...blah blah...but that isn't really a challenge anymore, i can
code that with my eyes closed i've done it that many times! I'm only
able to do command-line sort of apps because I'm still learning! :p
Any Suggestions?

Thanks for any help

*no flaming please, I don't like abuse, my self-esteam is low enough
as it is* :p

Try some of the problems at http://acm.uva.es/problemset/

rossum
 
M

Mike Wahler

Sinatra said:
I'll do that, thanks very much.
Going to need to slap some cash together first :p

While you're saving your nickels, check out the free
online book by Bruce Eckel, "Thinking in C++" at
www.mindview.net

This is the only online C++ text that's consistently
'approved' by the 'gurus.'

In the mean time, can anyone suggest any exercises that they've done in the
past? :)

Off the top of my head (I've done some but not all of these):

Text adventure games.

Card games (e.g. poker, rummy)

Address book.

Traffic signal simulations (could be e.g.
'traditional' stoplights, or perhaps a railroad
switching system).

Conversions, e.g. between metric and U.S. measurements

Mainly try to find an application that you like,
to keep your interest when you run into difficulty.

Friends and family members are often a good source
of ideas.

-Mike
 
M

Mike Wahler

Sinatra said:
thanks for the suggestions guys, really appreciate it.
i'm still having a go at that calculator :p
getting a syntax error during compilation though.

Show us the code and the error messages, and we'll try to
help.

Also, a good book (or two, or more) will help greatly.
You didn't say if you have any, or if you do, which
one(s).

BTW please don't top-post (if you don't know what that
means, look it up)

-Mike
 
S

Sinatra

cheers Mike :)
Mike Wahler said:
While you're saving your nickels, check out the free
online book by Bruce Eckel, "Thinking in C++" at
www.mindview.net

This is the only online C++ text that's consistently
'approved' by the 'gurus.'



Off the top of my head (I've done some but not all of these):

Text adventure games.

Card games (e.g. poker, rummy)

Address book.

Traffic signal simulations (could be e.g.
'traditional' stoplights, or perhaps a railroad
switching system).

Conversions, e.g. between metric and U.S. measurements

Mainly try to find an application that you like,
to keep your interest when you run into difficulty.

Friends and family members are often a good source
of ideas.

-Mike
 
I

Ioannis Vranos

Dave said:
I recently started to learn C++, i have a rough idea on most things in
the language and my knowlage is slowly expanding. The problem is, I'm
getting "artist-block", I cannot think of anything to code for
practice, i've been doing couts and cins such as, enter a
number...blah blah...but that isn't really a challenge anymore, i can
code that with my eyes closed i've done it that many times! I'm only
able to do command-line sort of apps because I'm still learning! :p
Any Suggestions?

Thanks for any help

*no flaming please, I don't like abuse, my self-esteam is low enough
as it is* :p


I have not a particular exercise idea in mind (you can do a phone book
may be?), however my general advise is finish some beginner to
intermediate level book (by the way which one are you reading?) and then
you can learn some platform-specific programming (Windows/.NET, Linux,
etc) and then learn more C++, etc.


This is the path that I follow.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top