Friday, August 21, 2015

15. Computer Programming with flowcharting Technique (page 15)


6.2. Looping and single looping
Problem 10
You are asked to makes program to print article NEW YORK 10 times , then prints on start number - 4 until number 100 with difference 7

Solution
To print word NEW YORK must be given iteration constrain 10 times
First number - 4 with difference = 7
Until number 100

Logic:
Does iteration 10 times to print word NEW YORK (Counter X)
Then does iteration to print number asked by determining initial number, different and last number 100. (Counter N)

Programming stages and steps:
Determines string variable to say NEW YORK
Determines initial number (non first number) that is - 4 -( 7) = - 11
Process looping with iteration 10 times for counter X and word NEW YORK
After completed does iteration to print number asked (Counter N)


FIG.17
Output :
NEW YORK NEW YORK NEW YORK - - - to 10 times then
Number - 4 3 10 17 and hereinafter

Followers

Blog Archive