Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that will declare an array of integers called radii that holds 10 integers representing the radii of 10 different circles. The

Write a C++ program that will declare an array of integers called radii that holds 10 integers representing the radii of 10 different circles. The diameters of the circles are multiples of 4. In the main function print the values to the screen in two ways:

1. on the same line separated by a comma (dont display the comma after the last element)

2. on different lines

Make sure to include the following:

- A function called calcArea() that finds the area of the circles whose radii are defined and stores it in another array called circleArea array.

Area of a circle:

Area = * radius2 where 3.14

In the main, use this function to print the calculated areas on one line separated by tabs.

- A function called printArrays() that reads the radii array and the circleArea array and prints the radii and areas of the circles on the screen as follows:

r1 a1

r2 a2

r3 a3

...

and so on.

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

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions