any small c++ project?

  • Thread starter ¨þ¨þ¨þ ¦ó
  • Start date
¨

¨þ¨þ¨þ ¦ó

I am a c++ beginner and i have finished the book c++primer. I am
looking forward to turning what i have learned into practice but i am
now confused and don't know what to do next. i am wondering if there
is some small projects that are suitable for me? i know c++ alone may
not be enough as it may involves other fields of knowledge such as
networking. If it does, can you recommend some books for it? thank
you!!
 
P

Pavel

呵呵呵 何 said:
I am a c++ beginner and i have finished the book c++primer. I am
looking forward to turning what i have learned into practice but i am
now confused and don't know what to do next. i am wondering if there
is some small projects that are suitable for me? i know c++ alone may
not be enough as it may involves other fields of knowledge such as
networking. If it does, can you recommend some books for it? thank
you!!
Ideally you have to come up with something from the domain area you know. This
way, you first simplify it to death but when your very first little project is
done (it may be as simple as 30 lines of code), you would have a million ideas
on what you want to add to it. Nobody from outside can give you this -- only
yourself or people who know you and your background because:

1. The key to success is to be interested in the result of the project and no
one knows your interests better than you do (or maybe people who know you well
and for long time).

2. Working in the area you do not know or not interested in you risk foraying
into easy paths or artificial exercises prompted by the programing language
(your choice of C++ practically guarantees you tons of distractions of both
kinds) and impeding your progress in learning how to apply it to real-world
problems.

HTH
-Pavel
 
S

Stuart Redmann

Ideally you have to come up with something from the domain area you know.This
way, you first simplify it to death but when your very first little project is
done (it may be as simple as 30 lines of code), you would have a million ideas
on what you want to add to it. Nobody from outside can give you this -- only
yourself or people who know you and your background because:

1. The key to success is to be interested in the result of the project and no
one knows your interests better than you do (or maybe people who know youwell
and for long time).

2. Working in the area you do not know or not interested in you risk foraying
into easy paths or artificial exercises prompted by the programing language
(your choice of C++ practically guarantees you tons of distractions of both
kinds) and impeding your progress in learning how to apply it to real-world
problems.


Pavel is right. However, it may be difficult for you to choose some
project to get your hands wet since you have only just started to
write code (I guess). So I think it won't hurt to give you some task
that is quite small, but still complex enough to use more
sophisticated features of C++. Here we go:

Write a console-based application that computes mathematical functions
and its derived functions. The first implementation should use a
function that is hard-wired into main (you should not be bothered with
I/O in the first stage, you can add this later on). The function
interface should look like this:

class Function
{
public:
virtual ~Function () {}
virtual double Compute (double x) const = 0;
virtual Function* Derive () const = 0;

//
// Whatever additional methods that are required for
// technical reasons (you have to figure for yourself).
//
};

Your main should look like that:

int main ()
{
Function* f;

//
// some code that assigns f to the function x->3*x^2
//

std::cout << f->Compute (5.0) << std::endl;
std::cout << f->Derive ()->Compute (0.3) << std::endl;
}

The result should then be
75
1.8


This task is actually from a course for high school students.


Regards,
Stuart
 
M

MikeP

Pavel said:
Ideally you have to come up with something from the domain area you
know. This way, you first simplify it to death but when your very
first little project is done (it may be as simple as 30 lines of
code), you would have a million ideas on what you want to add to it.
Nobody from outside can give you this -- only yourself or people who
know you and your background because:
1. The key to success is to be interested in the result of the
project and no one knows your interests better than you do (or maybe
people who know you well and for long time).

2. Working in the area you do not know or not interested in you risk
foraying into easy paths or artificial exercises prompted by the
programing language (your choice of C++ practically guarantees you
tons of distractions of both kinds) and impeding your progress in
learning how to apply it to real-world problems.

Excellent answer. Of course, though, you will have to do much more
reading and studying of the language (and perhaps others), but don't go
overboard on either reading/studying or DOING. Balance, and as the above
poster said, know thyself (or figure out who you are, which may be a
concurrent project).
 
M

MikeP

Stuart said:
Pavel is right. However, it may be difficult for you to choose some
project to get your hands wet since you have only just started to
write code (I guess). So I think it won't hurt to give you some task
that is quite small, but still complex enough to use more
sophisticated features of C++. Here we go:

Write a console-based application that computes mathematical functions
and its derived functions. The first implementation should use a
function that is hard-wired into main (you should not be bothered with
I/O in the first stage, you can add this later on). The function
interface should look like this:

class Function
{
public:
virtual ~Function () {}
virtual double Compute (double x) const = 0;
virtual Function* Derive () const = 0;

//
// Whatever additional methods that are required for
// technical reasons (you have to figure for yourself).
//
};

Your main should look like that:

int main ()
{
Function* f;

//
// some code that assigns f to the function x->3*x^2
//

std::cout << f->Compute (5.0) << std::endl;
std::cout << f->Derive ()->Compute (0.3) << std::endl;
}

The result should then be
75
1.8


This task is actually from a course for high school students.


Regards,
Stuart

Oh, "way to go" Stuart: throw some more boring math at a student he'll
become disinterested in programming as much as math!
 
S

Stuart Redmann

Stuart Redmann wrote:

[snipped small programming task about computation of derived
functions]
Oh, "way to go" Stuart: throw some more boring math at a student he'll
become disinterested in programming as much as math!

Well, I chose the example because it is
(A) small,
(B) a good example of object-oriented programming,
(C) doesn't need any knowledge (except for console-based I/O), and
(D) can be extended in many ways.

From my point of view, any computer scientist that is worth his money
will be quite interested in math (or else he'll end up hacking some
web interfaces ;-) Since calculus is really basic stuff, I do not have
to explain the problem domain too much, and the task at hand is
actually performing some useful stuff.

If you have better tasks at hand, feel free to post them.

Regards,
Stuart
 
M

MikeP

Stuart said:
Stuart Redmann wrote:

[snipped small programming task about computation of derived
functions]
Oh, "way to go" Stuart: throw some more boring math at a student
he'll become disinterested in programming as much as math!

Well, I chose the example because it is
(A) small,
(B) a good example of object-oriented programming,
(C) doesn't need any knowledge (except for console-based I/O), and
(D) can be extended in many ways.

From my point of view, any computer scientist that is worth his money
will be quite interested in math (or else he'll end up hacking some
web interfaces ;-) Since calculus is really basic stuff, I do not have
to explain the problem domain too much, and the task at hand is
actually performing some useful stuff.

If you have better tasks at hand, feel free to post them.


Who said he wanted to be a computer scientist? Math is way over-rated as
being a requirement (read, it is not one) for being a software developer.
Calculus is not "really basic stuff". Addition/subtraction is. Math
problems are boring.
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top