Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in C++ assignment. please add statements for each line of codes Requested files : CountDecades.cpp (Download) Maximum upload file size : 96

I need help in C++ assignment. please add statements for each line of codes

Requested files: CountDecades.cpp (Download) Maximum upload file size: 96 KiB

Write a C++ program named CountDecades.cpp. In this program you will have two integer arrays. One named inputArray of size 20 containing the values:

83, 2, 23, 11, 97, 23, 41, 67, 16, 25, 1 , 4, 75, 92, 52, 6, 44, 81, 8, 64

in the order specified, and an empty integer array of size 10 named outputArray.

The values in the input array range from 1 through100 inclusive, Write your C++ application using only functions that you create in your program. Your program must count the number of elements ininputArraythat fall into each decade, i.e each group of 10 between 0 and 100.:

When your program completes, outputArray should contain the number of elements that fall in each of the ranges 0-9, 10-19, 20-29, 30-39, .... 90-99

The index where a count is placed should correspond to which decade the count represents. For example the count of numbers that fall in the range 0-9 should be placed in the first element or outputArray[0] , The count of numbers that fall in the range 10-19 should be placed in the second element oroutputArray[1], and so on.

You program should print only one thing to the console, the contents of outputArray one one line with only spaces separating the elements followed by a newline (' ')

Helpful Tips:

You can copy the array initialization values by highlighting them and pressing ctrl-c

You can use the description in the introductory comment of your code.

Be sure to click the "Evaluate" button to test your program and receive a grade.

Partial credit will be given so be sure to describe your algorithm and comment your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions