Ask your own question, for FREE!
Computer Science 7 Online
kekeman:

Suppose you are writing a program that counts the number of alphanumeric characters in every sentence in a document. Would you use a for loop or a while loop to process each sentence, and why? A for loop because the program must establish maximum sentence length. A for loop to control the number of characters the program will process in each sentence. A while loop because the program cannot predict the length of a sentence. A while loop to specify the list of alphanumeric characters the program will recognize.

Vocaloid:

When you use a for loop, you generally need to know how many times you need to iterate through the loop In this case, we don’t know ahead of time how long the sentences, so we don’t know how many times the loop needs to iterate. So in this case, a while loop would be better.

kekeman:

Hmmm so C.) sounds like the better option " A while loop because the program cannot predict the length of a sentence."

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Countless7Echos: Ah trying out the whole T.V girl drawing :p (I love drawing eyes)
3 hours ago 13 Replies 6 Medals
kaelynw: starting to draw a hand
12 hours ago 17 Replies 2 Medals
Twaylor: Rate it :D (Took 2 days)
4 days ago 7 Replies 0 Medals
XShawtyX: Art, Short Writing Assignment: Imagining Landscapes
6 minutes ago 9 Replies 1 Medal
XShawtyX: Chemistry, Help ud83dude4fud83cudffe
5 days ago 13 Replies 1 Medal
kaelynw: tried a lil smt, the arm is off but i like the other stuff
5 days ago 27 Replies 3 Medals
kaelynw: art igg
5 days ago 14 Replies 1 Medal
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!