A coding challenge! Finish the code below, and draw a

A coding challenge! Finish the code below, and draw a bar chart as displayed, given the following grades array, initialized with values and counter array which holds the grade range totals, being primarily, in groups of 10.

00-09:

10-19:

20-29:

30-39:

40-49:

50-59:

60-69: **

70-79: ***

80-89: **

90-99: **

100: *

        int grades[] = { 60, 70, 75, 100, 61, 83, 90, 89, 72, 91 };

        int counter[] = new int [grades.length + 1];

        for ( int i = 0; i < grades.length; ++i) { // loop over entire array

        /* inspect each element and increment the index

            if the grade is in a certain range (ex. 0-9, 10-19…) */

        if (grades[i] == 100) { // account for the odd ball

          counter[10]++;

        else

          counter[(grades[i] % 100) / 10]++;

        }

       // create the code below to show the bar chart per the ranges shown above

 

Leave a Comment

Your email address will not be published. Required fields are marked *

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top