kbjones81 has asked for the wisdom of the Perl Monks concerning the following question:
I have no idea how to do these problems. Any help would be greatly appreciated! Thanks!
Write a Perl program to print the final values of variables G, H, and I. Create a flowchart for this program.
Start G = 18 H = 2 I = 13 if H = 2 perform Change-GI endif while I > 7 perform Change-HI endwhile if G = 2 then perform Change-G endif if I = G then perform Change-G else perform Change-HI endif print G, H, I End Change-GI while I > 5 I = I - 3 G = 0 endwhile Return Change-HI H = H + 2 I = I - 4 Return Change-G G = G + 1 H = H - 1 Return
Write a Perl program to print he final values of variables X, Y, and Z. Create a flowchart for the program. Submit via Blackboard (1) your Perl program, (2) your flowchart and (3) the runtime screen display.
Start X = 3 Y = 2 Z = 12 while Z > 8 perform Change-YZ endwhile if X = 2 then perform Change-X endif if Z = 4 then perform Change-X else perform Change-YZ endif print X, Y, Z End Change-YZ Y =Y + 2 Z =Z - 4 Return Change-X X = X + 1 Y = Y - 1 Return
Formatting added by davido per consideration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Homework Problems
by planetscape (Chancellor) on Jul 17, 2006 at 00:18 UTC | |
|
Re: Homework Problems
by chromatic (Archbishop) on Jul 16, 2006 at 23:48 UTC | |
|
Re: Homework Problems
by Marza (Vicar) on Jul 17, 2006 at 03:42 UTC | |
|
Re: Homework Problems
by GrandFather (Saint) on Jul 17, 2006 at 21:19 UTC | |
|
Re: Homework Problems
by mikasue (Friar) on Jul 17, 2006 at 16:08 UTC |