#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double a;
double b;
a =(3.0);
b =(5.0);
cout << " " << fixed << setprecision (1) << a << "\n" << endl;
cout << "* " << fixed << setprecision (1) << b << "\n" << endl;
cout << "------" << endl;
cout << fixed << setprecision (2) << a*b << "\n" << endl;
system("PAUSE");
return 0;
}
int calculate ()
{
double a;
double b;
double c;
a = (7.1);
b = (8.3);
c = (2.2);
cout << fixed << setprecision(1) << endl;
cout << " " << fixed << setprecision (1) << a << "\n" << endl;
cout << "* " << fixed << setprecision (1) << b << "\n" << endl;
cout << "- " << fixed << setprecision (1) << c << "\n" << endl;
cout << "------" << endl;
cout << std::setprecision(2) << (a * b) - c << "\n" << std::endl;
system("PAUSE");
return 0;
}
PLEASE don’t just tell me to read an intro c++ book or tell me my problem in a vague way, I have 1, it leaves out really tiny details like this. Sadly I’ve been working on getting this to work for an hour now lol.
Output:
1>—— Build started: Project: 1.2, Configuration: Debug Win32 ——
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>c:\users\justin\desktop\1.2\Debug\1.2.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
You need to add the source file to the Visual Studio project.
Right click on the “1.2” project in Solution Explorer, select “Add/Existing item…” then navigate to the source file.
Then try building again.
Once you have the build working, you can worry about integrating the call to the
calculate()function into the program (it’ll probably be much easier at that point).