8.) (35) write one complete c++ program to calculate the circumference (c 2PIr)
ID: 3833008 • Letter: 8
Question
8.) (35) write one complete c++ program to calculate the circumference (c 2PIr) of a circle and the area PIr2) of a circle. The radius should be entered from a input file and should set up as a in the program. The area, and circumference will be stored on an output file with headings. You do not have to include the 2 columns of information at the top of the program or the program description. However, do include any preprocessor commands (like include, etc). This program should include at least 4 functions: read FileData, PrintFileData, calcArea and calcCircumference. Use your own end of file processing a trailer of -1, a count in front of the data on the file, or a test for fin.eof().Explanation / Answer
#include<iostream>
using namespace std;
int main()
{
float PI=3.14;
float radius,area,circum;
cout<<"Enter radius of circle: ";
cin>>radius;
area=PI*radius*radius;
circum=2*PI*radius;
cout<<"Area of circle: "<<area<<endl;
cout<<"Circumference of circle: "<<circum;
return 0;
}
***********************************************************************************************
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.