Hi everyone, been a lurker for awhile and I have a question that I'd appreciate help with.
I'm working on a program which asks to display three asterisks at the end of every 3rd line of output. So far I have the following , but I'm just confused about how to go about this.
Output:
Any hints / comments would be appreciated. Thanks!
Write out on paper how you would explain to a child how to do what you want. Then revise the steps, making them simpler and simpler. Once you have that done, come back and we'll talk more.
Basically I need the output to read an asterisk in every third line..
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I know a modulus is needed but I can't figure it out.
Larson Lowe wrote:Basically I need the output to read an asterisk in every third line..
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I know a modulus is needed but I can't figure it out.
As fred mentioned, try to do it on paper first. To figure out how to do it *and* to teach the computer how to do it, at the same time, is a skill that takes practice. Try to figure out the design first -- on paper.
Larson Lowe wrote:Basically I need the output to read an asterisk in every third line..
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I like to sit by the fireplace.
I like to sit by the fireplace.
I like to sit by the fireplace. ***
I know a modulus is needed but I can't figure it out.
For what it's worth, that is not what I asked you to do. That is an example of the output you want. That does not tell someone how to do it.
Post by:autobot
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
a bit of art, as a gift, the permaculture playing cards