i m in A csc class in college. And everytime the prof. Gives a lab i have a hard time starting it i always neeed some classmate to help me start it ... Any ideas on how i should approach the labs

Recommended Answers

All 15 Replies

How to start will depend on the problem. They all start like this:

// include header files here

// declare function prototypes (if needed) here

int main()
{
   // put code here
}

Lol... I kno that.

Well then, Do you expect us to look into your future, find out the different types of problems you will face in class, and explain them to you now? There is nothing more we can tell you about starting a program. It all depends on what program you are writing as Ancient Dragon said.

If you worded your question wrong, then please try to rephrase.

Damn.... your harsh...and right .....

Not harsh -- tough love :)

Normally you will want to break down the problem into its simplest parts, then code them one at a time -- divide and conquer style. Compile and test each part before going on to the next part. The worst thing you can do is to write 100 lines of code without compiling it. Compile and fix compile errors frequently. When you get several compiler errors, fix the first one then compile again to get a new list of errors. Fixing one err may actually fix a million other errors.

Not harsh -- tough love :)

Normally you will want to break down the problem into its simplest parts, then code them one at a time -- divide and conquer style.

Amen!

I would suggest you study algorithm writing. You will be more successful if you come up with a basic algorithm for your program before you begin writing code. Then, you use your algorithm as a guide. It's really as simple as this:

  1. If you need something from the user, get input from them
  2. If the user needs information, give them output
  3. If you need to make a decision, use an if or a switch
  4. If you need to do something multiple times, put it in a loop.

Really all you need to do is combine those ideas in the right quantities and in the proper order to produce what's required. The specific inputs and outputs are usually given to you in your assignment's write-up.

i like it Fbody(Thanks)...... and it helps thanks.... any idea where i can find some algorithm examples? if non its okay too ill look in the book..

i like it Fbody(Thanks)...... and it helps thanks.... any idea where i can find some algorithm examples? if non its okay too ill look in the book..

If your book is even half way decent it will have examples you can pull from.

What you really need to think about is "How would I accomplish this task if I had to do it myself?". Once you answer that question properly, you have your algorithm. Programming is really nothing more than explaining to the computer how you would perform the task. You just need to do it very clearly and in the computer's language... It's written communication, just like an instruction manual, a book, an e-mail, or a letter.

If your book is even half way decent it will have examples you can pull from.

What you really need to think about is "How would I do this if I had to do it?". Once you answer that question properly, you have your algorithm. Programming is really nothing more than explaining to the computer how you would perform the task. You just need to do it very clearly and in the computer's language... It's written communication, just like an instruction manual, a book, an e-mail, or a letter.

see this helps......thanks again

WOW! Not be too harsh, but doesn't your professor/college teach about pseudo code?
I am just learning C++, but my textbook stresses that the most important part of programming is organizing your thoughts and ideas. This is done by writing pseudo code and a grammar BEFORE writing the program code itself. Put the horse before the cart.

commented: good point :) +33

:(
I don't really think that was necessary. It seems to me that the pseudo code and the grammar are the parts that the OP is having trouble with. How can you organize your thoughts if you if you can't generate thoughts to organize? The concept of an algorithm doesn't come as easily to some as it does to others.

@fbody,

You have a point. Perhaps the OP can give an example of a lab he is having difficulty starting and we can help him write pseudo code for it?

The whole purpose of pseudo code and flow charts is to organize your thoughts. Its like writing a draft in English 101 class. Learn to write pseudo code and the rest will come a lot easier.

ma dear i dont know weather its ma knowledge or try to knw your header files by hard then you than with c++ cause i just realise if you knw dat C++ its water then ull xcel!!!1 i prefer you get ds malik text book cause its Simple Staightforward email me ur email will give you slide and tutorials

commented: Huh? Speak English, not 1337 :( +0
commented: What? We speak English here, not gibberish. -6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.