Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,065 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,154 people online right now. Registration is fast and FREE... Join Now!




I need Small Loop challenges

 
Reply to this topicStart new topic

I need Small Loop challenges, I want any tutorial or loop challenging questions

dinisrainman
post 5 Mar, 2008 - 12:00 PM
Post #1


New D.I.C Head

*
Joined: 10 Feb, 2008
Posts: 24

I know the policy. so im not asking for answers. what i want is a tutorial with challenging loop problems. As well as if anybody has a difficult question about looping. The reason is because, loops are really important in programming. As a beginner i want to go deep about all three loops.
A guide to any tutorial is much appreciated.

Thanks to all dreamcode members.
User is offlineProfile CardPM

Go to the top of the page

captainhampton
post 5 Mar, 2008 - 12:11 PM
Post #2


Jawsome++;

Group Icon
Joined: 17 Oct, 2007
Posts: 518



Thanked 2 times

Dream Kudos: 825
My Contributions


Honestly, when you begin to obtain the programmer mentality you can turn anything into a potential computer program. Just take a look at different aspects of your day that you could find congruencies in to begin your own loop problems. Or if you happen to need some inspiration, you could always use google to spark the loop ideas.
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 5 Mar, 2008 - 12:14 PM
Post #3


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,168



Thanked 33 times

Dream Kudos: 25
My Contributions


I guess we would have to know what is meant by challenging loop problems. Loops themselves always work the same way (perhaps with a few different parameters)...it's what you do in the loop that counts. smile.gif
User is offlineProfile CardPM

Go to the top of the page

Martyr2
post 5 Mar, 2008 - 12:19 PM
Post #4


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 5,012



Thanked 171 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


Some challenges you could try...

1) Create a program that displays various shapes using asterisks. Create a rectangle, right triangle facing left and one facing right, an equilateral triangle and most of all a diamond. Do these with only for loops.

2) Using only a while loop, create a program that asks a user to specify multiple integers and adds them up until it reaches a sentinel value like 9999. Divide this sum by the number of integers that were inputted by the user to get the average. Example the user enters... 4, 3, 2, 3 = 12 / 4 terms = average of 3.

3) With only two for loops, create a bubblesort algorithm that has a fixed number of passes and no longer takes into account values that have already been properly sorted (that is values that have already been bubbled up).

If you need a quick refresh on the format of the various types of loops, you can check out the link below. Enjoy!

C++ and Loops
User is offlineProfile CardPM

Go to the top of the page

dinisrainman
post 5 Mar, 2008 - 01:58 PM
Post #5


New D.I.C Head

*
Joined: 10 Feb, 2008
Posts: 24

thanks to all your suggestions, much appreciatted.
User is offlineProfile CardPM

Go to the top of the page

red_4900
post 5 Mar, 2008 - 02:01 PM
Post #6


D.I.C Addict

****
Joined: 22 Feb, 2008
Posts: 789



Thanked 10 times
My Contributions


is there any website where I can get programming challenges? there's a lot out there for expert, but not for beginners. and I'm suck at programming. juz wanna practice.

or maybe DIC can make a monthly programming challenges for beginner. icon_up.gif
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/21/08 07:17AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month