HELP! How do you make an Algorithmic loop?

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Thread Solved

Join Date: Oct 2009
Posts: 5
Reputation: Kellbell147 is an unknown quantity at this point 
Solved Threads: 0
Kellbell147 Kellbell147 is offline Offline
Newbie Poster

HELP! How do you make an Algorithmic loop?

 
0
  #1
Oct 8th, 2009
I had to take computer science for my major, but I have no idea what's going on in this class.

I have to write an algorithm that reads in ten positive integers from the keyboard (upper size limit is 99). Output the additive total of the ten numbers and also output the smallest of those ten numbers. Illegal inputs (<1 or >99) are to be discarded and a replacement entry accepted if legal.

can anybody PLEASE tell me what this means
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 947
Reputation: MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice 
Solved Threads: 92
MosaicFuneral's Avatar
MosaicFuneral MosaicFuneral is offline Offline
Posting Shark
 
0
  #2
Oct 8th, 2009
You already just gave the "algorithm", so what do you need? Is it that you have no concept of how to write this in somesort of pseudo-code?
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 5
Reputation: Kellbell147 is an unknown quantity at this point 
Solved Threads: 0
Kellbell147 Kellbell147 is offline Offline
Newbie Poster
 
0
  #3
Oct 8th, 2009
yeah I don't know how to start or how to even write this thing
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 455
Reputation: Grn Xtrm is on a distinguished road 
Solved Threads: 36
Grn Xtrm's Avatar
Grn Xtrm Grn Xtrm is offline Offline
Posting Pro in Training
 
0
  #4
Oct 8th, 2009
A for loop will allow you to have a user enter the ten numbers
for(variable=1 to variable is less than or equal to 10, then increment the variable)
//In the body of the loop you will ask the users to enter the numbers
Did you have a specific programming language in mind?
Last edited by Grn Xtrm; Oct 8th, 2009 at 7:24 pm.
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 5
Reputation: Kellbell147 is an unknown quantity at this point 
Solved Threads: 0
Kellbell147 Kellbell147 is offline Offline
Newbie Poster
 
0
  #5
Oct 8th, 2009
i don't know how to start a loop or write an algorithm how do you write this?
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 455
Reputation: Grn Xtrm is on a distinguished road 
Solved Threads: 36
Grn Xtrm's Avatar
Grn Xtrm Grn Xtrm is offline Offline
Posting Pro in Training
 
0
  #6
Oct 8th, 2009
Originally Posted by Kellbell147 View Post
i don't know how to start a loop or write an algorithm how do you write this?
If your not using a specific programming language and just want psuedocode, my previous post should be ok for you. Well the loop part at any rate.
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 5
Reputation: Kellbell147 is an unknown quantity at this point 
Solved Threads: 0
Kellbell147 Kellbell147 is offline Offline
Newbie Poster
 
0
  #7
Oct 8th, 2009
it says using a PDL of your choice
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 455
Reputation: Grn Xtrm is on a distinguished road 
Solved Threads: 36
Grn Xtrm's Avatar
Grn Xtrm Grn Xtrm is offline Offline
Posting Pro in Training
 
0
  #8
Oct 8th, 2009
Originally Posted by Kellbell147 View Post
it says using a PDL of your choice
And what is your choice?
My personal favorite language is C++.
for(int i=1; i<=10; i++)

Have you ever learned about something called an array?
That could be used to store the 10 values, but if you've never learned arrays then there is a less effiecient way to solve your problem.
Last edited by Grn Xtrm; Oct 8th, 2009 at 7:53 pm.
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 5
Reputation: Kellbell147 is an unknown quantity at this point 
Solved Threads: 0
Kellbell147 Kellbell147 is offline Offline
Newbie Poster
 
0
  #9
Oct 8th, 2009
I don't even know what a PDL is but we're suppose to write the algorithm i stated above and make a matching code using C++ so with both ways work?
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 947
Reputation: MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice 
Solved Threads: 92
MosaicFuneral's Avatar
MosaicFuneral MosaicFuneral is offline Offline
Posting Shark
 
0
  #10
Oct 8th, 2009
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC