Question: Write a short program that uses aWhileorForloop to populate an array. The array can store up to 12 integers or floats. Be sure your array

Write a short program that uses aWhileorForloop to populate an array. The array can store up to 12 integers or floats. Be sure your array variables are descriptive.

Some examples:Store 12 months of monthly rainfall; Store 12 months of monthly miles run; Store the weekly grocery costs for X weeks.; Store X days/weeks/months of the daily/weekly/monthly mileage to work/school.

Optionally,you may write a second loop to display the collected data. Or display the total sum.

Document your code with Header and in-line comments.Be sure toaccurately describein yourHeader commentswhat the code is designed to do.

THEN:Modify the code slightly to create a bug (no more than 2) that would prevent the code from compiling or even better from running correctly. But don't document the bug.Submit the buggy code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!