1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include <iostream>
using namespace std;
void main()
{
system("cls");
int E;
int S;
int T;
int R;
int P;
int A;
int X;
cout << "---------------" << endl;
cout << " Menu Options: " << endl;
cout << "---------------" << endl;
cout << " Ellipse " << E << endl;
cout << " Sector " << S << endl;
cout << " Triangle " << T << endl;
cout << " Rhombus " << R << endl;
cout << " Pentagram " << P <<endl;
cout << " About " << A << endl;
cout << " Exit " << X << endl;
cout << "---------------" << endl;
}
//
void E()
double a, b, result;
cout << "Enter the first number please." endl;
cin << a;
cout << "Enter the second number please." endl;
cin << b;
result = a * b;
cout << "Area = " << result << endl;
system("pause");
}
|
And my errors.
1>------ Build started: Project: Calculator, Configuration: Debug Win32 ------
1>Compiling...
1>Calculator.cpp
1>.\Calculator.cpp(28) : error C2144: syntax error : 'double' should be preceded by ';'
1>.\Calculator.cpp(30) : error C2143: syntax error : missing ';' before '<<'
1>.\Calculator.cpp(30) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Calculator.cpp(31) : error C2143: syntax error : missing ';' before '<<'
1>.\Calculator.cpp(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Calculator.cpp(32) : error C2143: syntax error : missing ';' before '<<'
1>.\Calculator.cpp(32) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Calculator.cpp(32) : error C2086: 'int cout' : redefinition
1> .\Calculator.cpp(30) : see declaration of 'cout'
1>.\Calculator.cpp(33) : error C2143: syntax error : missing ';' before '<<'
1>.\Calculator.cpp(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Calculator.cpp(33) : error C2086: 'int cin' : redefinition
1> .\Calculator.cpp(31) : see declaration of 'cin'
1>.\Calculator.cpp(34) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Calculator.cpp(34) : error C2371: 'result' : redefinition; different basic types
1> .\Calculator.cpp(28) : see declaration of 'result'
1>.\Calculator.cpp(34) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
1>.\Calculator.cpp(35) : error C2143: syntax error : missing ';' before '<<'
1>.\Calculator.cpp(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Calculator.cpp(35) : error C2086: 'int cout' : redefinition
1> .\Calculator.cpp(30) : see declaration of 'cout'
1>.\Calculator.cpp(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Calculator.cpp(36) : error C2365: 'system' : redefinition; previous definition was 'function'
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(521) : see declaration of 'system'
1>.\Calculator.cpp(36) : error C2440: 'initializing' : cannot convert from 'const char [6]' to 'int'
1> There is no context in which this conversion is possible
1>.\Calculator.cpp(37) : error C2059: syntax error : '}'
1>.\Calculator.cpp(37) : error C2143: syntax error : missing ';' before '}'
1>.\Calculator.cpp(37) : error C2059: syntax error : '}'
1>Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2008\Projects\Calculator\Calculator\Debug\BuildLog.htm"
1>Calculator - 22 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm still trying to figure this out. I got more errors than I had with my first issue...
-____-