Code:
#include<conio.h>
#include<iostream>
using namespace std;
int main()
{
double ManfCode,ProdCode;
int Checkdigit, SecondManf, FourthManf;
int FirstProd,ThirdProd,FifthProd;
int SecondProd,ForthProd;
int FirstManf,ThirdManf,FifthManf;
int endA, endB, endC, endD, endE, endF, endG;
int assist1=0,assist2=0,assist3=0;
cout<<"Please enter the Manufacturer Code below"<<endl;
cin>>ManfCode;
if((ManfCode > 99999)||(ManfCode<10000)) {cout<<"Error, Re-Enter the Manufacturer Code"<<endl;
cin>>ManfCode;}
cout<<"Please enter the Product Code below"<<endl;
cin>>ProdCode;
if((ProdCode > 99999)||(ProdCode<10000)) {cout<<"Error, Re-enter the Product Code"<<endl;
cin>>ProdCode;}
cout<<"Please enter the Check Digit below"<<endl;
cin>>Checkdigit;
if((Checkdigit > 9)||(Checkdigit<0)) {cout<<"Error, Re-enter the Check Digit"<<endl;
cin>>Checkdigit;}
cout <<"The UPC code you entered is \n"<< "0 "<<ManfCode<<" "<<ProdCode<<" "<<Checkdigit<<endl;
assist1= 10000% ManfCode;
SecondManf= static_cast<int>(assist1/1000);
cout <<"The second number for the manufacturer is " <<SecondManf<<endl;
assist2= (int)ManfCode % 100;
FourthManf= static_cast<int>(assist2/10);
cout <<"The fourth number for the manufacturer is " <<FourthManf<<endl;
endA= SecondManf+FourthManf;
cout <<"The end result for the second and the fourth manufacturer is " <<endA <<endl;
getch();
return 0;
}
Thats my code for Validating A UPC Code
How do i eliminate the error?
I got this error: error C2297: '%' : illegal, right operand has type 'double'
Comment