Jump to content

Recommended Posts

Posted

damn that programming professor of mine. >:(.. he gave us a tremendous assignment, here:

You can now research a problems(Programming problems)

10 Nested loops

10 Dimensional arrays

10 Single arrays

10 problems using strings(toupper, tolower etc..)

please help me.. or can u give me a site where i can find them?? thanks a lot!! ;D

Posted

Does "10 Nested loops" mean you have to create 10 random code examples using nested loops? How dull is that?

And what language are we talking about?

Posted

Does "10 Nested loops" mean you have to create 10 random code examples using nested loops? How dull is that?

And what language are we talking about?

Or just TWO random code examples ;-) (lame joke I know)

I imagine since you're just starting, it'd be C that you're currently studying?

Posted

turbo c. our prof wants us to provide 10 examples of each given. 10 examples of programs with the use of nested loops.

Ah, never did Turbo C, how different is it from regular C? Does this make sense to you in C? :

for(int i=0;i<10;i++) {

  for(int j=5;j>i;j--) {

    j = j+i;

  }

}

See the for loop within the for loop? While I can't imagine what use this piece of code would be (I guess in some situations it might help), it would be an example of a nested loop.

Posted

How different do they have to be between each other? Like, could you just make a nested for loop and a nested while loop for two examples and change variables to create 10 examples? Not sure how indepth your professor wants to go.

Posted

oh yes that one does.. we are required to provide 10 sample programs (code and output).

Are you making us do your homework ?

Usually you can get lots of examples in the documentation to copy and use. You might want to try the MS and Borland support sites.

I imagine since you're just starting, it'd be C that you're currently studying?

They made me start with BASIC and compiler.

After that Pascal Delphi SQL . .... with C (C++, C# ..) after a while, just before Java. It's strange that after a few years everything looks like BASIC with a few extra's.. :P

Posted

I used to use this site for snippets of code to help me out:

http://www.planetsourcecode.com/

Your assignment doesn't make a whole lot of sense, why 10 different iterations (:P) of a simple nested loop ? Once you done one, you've done em all. How much different can they get ? Shure, the inputs and outputs are different, but the nested bits stay pretty much similar.

Posted

Feel free to call him names...I feel a pent up anger from you at his behaviour. Swear if it will help you vent some anger...

Hold a knife at him and say C# !  :P

  • 2 weeks later...
Posted

dunno, my prof juz gave us that assignment, juz posted it in his yahoo group without even any explanations.

Sounds like a lame programming assignment to me.

this is what I would submit:



while(1)
{
  print("lame 1");
  while(2)
  {
    print("lame2");
    exit();
  }


}

while(2)
{
  print("lame 2");
  while(3)
  {
    print("lame3");
    exit();
  }


}
while(3)
{
  print("lame 3");
  while(4)
  {
    print("lame4");
    exit();
  }


}
while(4)
{
  print("lame 4");
  while(5)
  {
    print("lame 5");
    exit();
  }


}
while(5)
{
  print("lame 5");
  while(5)
  {
    print("lame 6");
    exit();
  }


}


etc.....

Is this assignment that hard really?

Maybe you should find another course of study?

Posted

I will say in all the CS classes I took in college I never had an assignment like this one and that is why I gave such a simple answer. Based on the little information that was provided by the student my example would meet the 10 nested loops part of the assignment. I guess you could add the 10 Dimensional arrays (I am assuming 2 dimensions) 10 Single arrays, 10 string conversions(toupper, tolower etc..) to my example to handle all the work at once. Really when an instructor is vague like this how can he/she expect anything useful at all. All it sounds like to me is that the instructor wants the student to become familiar with these very basic programming concepts. This is one area where the student really should make sure he understands what the instructor is trying to teach and not look for examples online. You can't be a good programmer without learning how to solve problems yourself. Sure everyone looks at examples for new concepts, but the programmer needs to able to apply this information to the specific task at hand. 

Posted

The problem with many "educational" programming assignments is that they have little or no purpose. Programmers are trained in solving problems; not making them, as is the case here. You never hear from your employer: "Just make me some code, damnit... I don't care what it does as long as it's a loop!"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.