English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

printCoupons( )
const num MONTHS = 12
const num YEARS = 30
num monthcounter
num yearcounter
while yearcounter <= YEARS
while monthcounter <= 12
print month, year, "Remenber to send your payment by the 10th."
yearcounter = yearcounter + 1
endwhile
endwhile
endwhile
return

It is meant to print 360 payment coupons for a new borrower, and each coupon lists the month number, year number, and a friendly reminder.

2007-11-10 07:11:21 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

It is hard to tell if your code is right without indentations, but assuming you have taken care of them, here are the few things I noticed.

1. you didn't increment monthcounter
2. no initializations (to 0) of the counters.
3. don't you have to increment "month" and "year" or use arrays like month[monthcounter] or year[yearcounter]?

2007-11-10 07:20:52 · answer #1 · answered by soa 2 · 0 0

Well, to begin with you have two "while" statements and three "endwhile" statements. You also have your increment of yearcounter in the wrong place and don't increment monthcounter at all.

2007-11-10 07:15:45 · answer #2 · answered by jgoulden 7 · 1 0

fedest.com, questions and answers