2.pdf

# 2.pdf - constant something basic string arrays...

• No School
• AA 1
• 4

This preview shows page 1 - 4 out of 4 pages.

11/13/18 constant something, basic string, arrays, one-dimensional arrays, two-dimensional arrays area circle = pi r^2 circumference = 2 pi r area sphere = 4/3 pi r^3 constant would be pi , 4/3 could be a constant #include <iostream> using namespace std; int main() { float radius; float circle_area; float circle_circumference; float sphere_volume; cout << “Enter radius”; cin >> radius; circle_area = calcArea(radius) circle_circumference = calcCircumference(radius) } float calcArea(float rad) { const float PI = 3.1415927; float area; area = PI * rad * rad; return area; } float calcCircumference(float rad) { const float PI = 3.1415927; float circumference; circumference = pi * 2 * r; return circumference;

Subscribe to view the full document.

} float calcVolume(float rad) { float volume; volume = 4 / 3 * PI * pow(rad, 3) adding string.. s1) d o g \ s2) h o r s e \ s3 = s1 + s2; d o g h o r s e \ = void numbersArray()

Subscribe to view the full document.

• Fall '19
• NoProfessor

{[ snackBarMessage ]}

###### "Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern