Friday, August 21, 2015

16. Computer Programming with flowcharting Technique (page 16)


Problem 11You are asked to makes program to print article NEW YORK 10 times then townMETROPOLITAN counted 3 times.
The process is repeated 5 times

Solution
To print 10 times is given by iteration constrain 10 times with Counter A
To print 3 times is given by iteration constrain 3 times with Counter B
To repeat the process 5 times is determined with Counter C

Logic:
Does iteration 10 times to print word " NEW YORK"
Does iteration counted 3 times to print word " town METROPOLITAN"
Does iteration counted 5 times to redo the process.

Programming stages and steps:Determines string variable to say NEW YORK and town METROPOLITAN
Process looping with iteration 10 times for counter and word NEW YORK

DescriptionEvery completed printing 10 times word " NEW YORK" , counter A in zero isn't it ( A = 0)
( line number 100 )
So also completed printing 3 times word " town METROPOLITAN" counter B also in zero isn't it ( line number 140 ). This process alike in filling gasoline station. Having filling gasoline in each vehicle, counter in zero isn't it to start calculates gasoline litre at the next vehicle.

At problem 11 is counter zero A = 0 and B = movable 0 at line after number 50 for example 51 A = 0 and 52 B = 0 . Result of its is being equal.

FIG.18

Output
First iteration
NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK town METROPOLITAN town METROPOLITAN town METROPOLITAN
Second iteration
NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK NEW YORK town METROPOLITAN town METROPOLITAN town METROPOLITAN
etc until 10th iteration.

Followers

Blog Archive