Explore BrainMass
Share

Correct the program.

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

// Program accepts a student's year in school (1 to 4)
// and the number of cans collected for a recycling drive.
// Output is a report that lists each class year and
// the total number of cans collected by that class.
start
num year
num cans
num SIZE = 4
num collected[SIZE] = 0, 0, 0
string HEAD1 = "Can Recycling Report"
string HEAD2 = "Year Cans Collected"
input year, cans
while not eof
collected[year] = collected[year - 1] + cans
input year, cans
endwhile
print HEAD1
print HEAD2
year = 1
while year <= year
output year, collected[year - 1]
endwhile
stop

© BrainMass Inc. brainmass.com October 17, 2018, 3:45 am ad1c9bdddf
https://brainmass.com/computer-science/arrays/436370

Solution Preview

Please find my comments, marked with #, inserted in your program below, along with the corrections. Kindly compare the following corrected program with your original program in case you are not clear about what is corrected (though # comments should make it clear anyway).

// Program accepts a student's year in school (1 to 4)
// and the number of cans collected for a recycling drive.
// Output ...

Solution Summary

Comments are inserted around the corrections to explain what was corrected and the need for that.

$2.19
Similar Posting

Corrections - Alternative Sentencing Options

You work for a state judge as an administrative assistant. The judge is a proponent of alternative sentencing options but is frequently criticized for sentencing defendants to home detention, probation, community service etc. She has asked you to prepare an evaluation of the effectiveness of such options because he is scheduled to speak at a judge's conference dealing with sentencing issues.

1. Prepare a report on the effectiveness of alternative sentencing options and support your conclusions with data on rates of recidivism and savings of tax dollars earmarked for penal institutions.
2. What types of individuals should be considered for such programs? Please include references.

I need ideas and information to get me started. Thank you.

View Full Posting Details