CODE
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
void process (double num, double den);
double quotient (double dvdend, double dvsor);
int main()
{
//1. Declares a variable named inFile that represents an input stream.
ifstream inFile;
//2. Declares variables named dividend and divisor that hold REAL numbers.
double dividend, divisor;
//3. Opens the file input.txt (must be in the same folder where your program is executing).
inFile.open ("input.txt");
//4. if the file could not be opened
if (!inFile)
{
//Prints on the screen “Could not open the input file!”
cout << "Error opening file.\n";
//Finishes the program returning a 1.
return 1;
}
//5. Gets a couple of values from the file and stores them in dividend and divisor respectively.
inFile>>dividend;
inFile>>divisor;
//6. Calls function process( ) to process these two values according to the explanation shown below.
process(dividend,divisor);
//7. Closes the file.
inFile.close();
return 0;
}
void proccess (double num, double den)
{
//1. declares a local variable named division that holds real numbers.
double division;
//2. if num is not zero
if (den!=0)
{
//Assigns to division the value returned by the function called quotient( ).
division = quotient (num, den);
//Prints a message like the one below (fixed format with two decimal digits):
cout<<num<<" divided by "<< den<< " is "<<division<<endl;
//AA.AA divided by BB.BB is CC.CC
}
else
{
cout<<"Sorry, cannot solve division by zero!"<<endl;
}
}
double quotient(double dvdend, double dvsor)
{
double dvsion;
dvsion = dvdend/dvsor * 100.00;
return dvsion;
}
can somebody help me plz im getting this error message :fatal error LNK1120: 1 unresolved externals