Question
C++ The file below contains first and last names and the radii of circles. You'll need to cut and paste the data into a text
C++
The file below contains first and last names and the radii of circles. You'll need to cut and paste the data into a text file. Write a program to read the file and store the first names and the radii in two arrays. You'll need an array of type string and an another array of some numeric type. The arrays should each hold 12 elements. Then, print out the first names and the circle areas, each in a column of width 10. Make sure you match the implied output format and that you check for a successful file open. Include a function to calculate of the circle area, using the formula:
Area = PI * radius * radius
For PI, use a named constant equal to 3.14
Input data (copy to a text file):
LoriBeth Allen 79 Chachi Arcola 125 Richie Cunningham 171 Howard Cunningham 255 Marion Cunningham 252 Joanie Cunningham 234 Al Delvecchio 122 Arthur Fonzarelli 255 Ralph Malph 165 Roger Phillips 61 Jenny Piccalo 55 Potsie Weber 210
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started