Any expert who can help ? Help Find Errors. It has at least 6 errors

#include <iostream>
#include <cmath>
using namespace std;

const double PI = 3.141592654;

void ConeVolume(double x, double n);

int main()
{
double removedSectorLength;
double PaperRad;
double paperCupBaseRad; //r
double paperCupHeight; //h
double paperCupVol;
double PaperCircum;
double maxVolume;

// Program Introduction to User ...
cout << "\n\t ************************************************"
<< "\n\t * Simple program that calculates a Max Volume *"
<< "\n\t * cup-like container from ciruclar paper sheet *"
<< "\n\t * with a pie-shaped wedge cut out. *"
<< "\n\t ************************************************
<< "\n\n" << endl;

cout << fixed << showpoint << setprecision(6);

cout << "Enter the radius of the circular paper in inches: ";
cin >> PaperRad;
cout << endl;

x = 0.00;
removedSectorLength = 0.0;
PaperCircum = 2 * PI * PaperRad;

cout << fixed << showpoint << setprecision(2);

while (x <= PaperCircum)
{
paperCupBaseRad = PaperRad - (x / (2 * PI));
paperCupHeight = sqrt(PaperRad * PaperRad - paperCupBaseRad * paperCupBaseRad);

paperCupVol = (1.0 / 3.0) * PI * (paperCupBaseRad * paperCupBaseRad) * paperCupHeight;

if (paperCupVol <= maxVolume)
{
maxVolume = paperCupVol;
removedSectorLength = x;
}

x = x + 0.01;
}

cout << "Length of the removed sector: " << removedSectorLength << " inch"<< endl
cout << "\nMax Volume " << maxVolume << " cubic inches"<< endl;

// Simple Hold Screen Code for Command Prompt C++ Compilers
char holdscr; // This character and section is to hold screen open
cout << "\n\n\tPress a character and Enter to exit program. ";
cin >> holdscr;

return 0;
}
Last edited on
Sure, we can help you find the error, but so can your compiler.

24:4: warning: missing terminating " character
24:1: error: missing terminating " character
 In function 'int main()':
25:1: error: expected primary-expression before '<<' token
27:45: error: 'setprecision' was not declared in this scope
33:1: error: 'x' was not declared in this scope
56:1: error: expected ';' before 'cout'
Mind posting those errors so we would not have to withdraw out telepaths from vacation.
Thank you
Topic archived. No new replies allowed.