What is my code missing?
#include <iostream>
#include <string>
using namespace std;
const double PI = 3.141592;
const int LEGAL_AGE = 21;
int main()
{
double radius; // input variable holds
radius of circle
int age; // input
variable holds age of user
string name; // input
variable holds first name of user
// prompt user for radius
cout << "Please enter the radius of your circle:
";
cin >> radius;
// compute and display the area and
circumference
cout << "Area of circle of radius " <<
radius << ": " << ____;
cout << "\nCircumference of circle of radius "
<< radius << ": " << ____;
// prompt user for name and age
// and input name and age
cout << "\n Welcome, " << ____ << ",
you are " << ____ << " years old";
cout << "\n\nIf you are " << ____ <<
" or older, you can buy beer.";
cout << "\n\nIf you are " << ____ <<
" or older, you can get married w/o your parents'
permission.";
cout << "\n\nIf you are " << ____ - 3
<< ", you can vote.";
cout << "\n -- Done --" << endl;
return 0;
}
#include <iostream> #include <string> using namespace std; const double PI = 3.141592; const int LEGAL_AGE = 21; int main() { double radius; // input variable holds radius of circle int age; // input variable holds age of user string name; // input variable holds first name of user // prompt user for radius cout << "Please enter the radius of your circle: "; cin >> radius; // compute and display the area and circumference cout << "Area of circle of radius " << radius << ": " << (PI*radius*radius); cout << "\nCircumference of circle of radius " << radius << ": " << (2*PI*radius); // prompt user for name and age // and input name and age cout<<"Enter name: "; cin>>name; cout<<"Enter age: "; cin>>age; cout << "\n Welcome, " << name << ", you are " << age << " years old"; cout << "\n\nIf you are " << 18 << " or older, you can buy beer."; cout << "\n\nIf you are " << 18 << " or older, you can get married w/o your parents' permission."; cout << "\n\nIf you are " << 21 - 3 << ", you can vote."; cout << "\n -- Done --" << endl; return 0; }
Get Answers For Free
Most questions answered within 1 hours.