Announcements and Reminders
What is an array?
one variable, multiple parts, contiguous memory
pass entire array to a function
traverse an array
sort, search it
How to ...
How big is an array?
An array's address
Using a for loop
How big is any array?
Passing an array as a const
Swapping array elements
Lab Exercise #2
Put your name, the compiler used, and Lab Exercise #2 in a comment at the top of your program. Email your source code. You may email your lab solution prior to that.
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 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
Make sure you handle different EOF situations for the input file.
Input data (copy to a text file)