I can't fix it and it nearly drove me to drink due to the sheer amount of errors generated. I seriously doubt my knowledge of this C++ and i can't get help at all. wtf am I supposed to do its due tomorrow morning:
Its functions. fuck it im am changing my major come semester i CANT STAND coding. I want help but nobody is going to be able to clarify this convulted mess of code.#include <iostream>
using namespace std;
void GetInput (double& eightDigit);
void ShowResults (double eightDigit, double cDigit);
char CheckDigitOne (int eightDigit);
//Precondition: eightDigit is an 8-digit integer. No error
//checking on this input is done.
//Postcondition: An upper case letter is determined
//according to the rules above and returned.
void CheckDigitTwo (int eightDigit, char& ch);
//Precondition: eightDigit is an 8-digit integer. No error
//checking on this input is done.
//Postcondition: ch is an upper case letter determined
//according to the rules above.
int main()
{
int eightDigit, workingnumber,remains,TwoDigitOne,TwoDigitTwo,TwoDigitThree,TwoDigitFour;
char cDigit, answer;
do
{GetInput (eightDigit);
cDigit = CheckDigitOne;
cout << endl << endl <<"First results.\n";
ShowResults(eightDigit,cDigit);
cDigit = 0;
CheckDigitTwo(eightDigit, char ch);
cout << endl << endl <<"The second result.\n";
cout << "Would you like another go around?"
<<"Please press y for yes, any other key for no";
cin >> answer;
}while((answer=='Y')||(answer=='y'));
return 0;
}
void GetInput (const double& eightDigit)
{bool valid;
do
{
cout << "Please enter your 8-digit number now";
cin >> eightDigit;
valid=(eightDigit>10000000)&&(eightDigit<99999999);
if (!valid)
cout << "Sorry, try again.";
}
while (!valid);
}
void ShowResults (double eightDigit, char& ch)
{
cout << "Your new ID number is" << eightDigit
<< "with appended check digit (or character)" << cDigit
<< "Keep this number!\n";
}
double CheckDigitOne(int eightDigit)
(
return
int eightDigit, workingnumber,remains, TwoDigitOne,TwoDigitTwo,TwoDigitThree,TwoDigitFour;
char cDigit;
cout << "Enter your 8-digit ID number now.\n";
cin >> eightDigit;
workingnumber = eightDigit;
TwoDigitFour = workingnumber % 100;
workingnumber = workingnumber / 100;
TwoDigitThree = workingnumber % 100;
workingnumber = workingnumber / 100;
TwoDigitTwo = workingnumber % 100;
workingnumber = workingnumber / 100;
TwoDigitOne = workingnumber % 100;
remains = (TwoDigitOne+TwoDigitTwo+TwoDigitThree+TwoDigitFour) % 26;
cDigit = 'A' + remains;
}
void CheckDigitTwo (int& eightDigit, char& ch)
{
cDigit =
int eightDigit, workingnumber,remains, TwoDigitOne, TwoDigitTwo, TwoDigitThree, TwodigitFour;
char cDigit;
cout << "Enter your 8-digit ID number now.\n";
cin >> eightDigit;
workingnumber = eightDigit;
TwoDigitFour = workingnumber % 100;
workingnumber = workingnumber / 100;
TwoDigitThree = workingnumber % 100;
workingnumber = workingnumber / 100;
TwoDigitTwo = workingnumber % 100;
workingnumber = workingnumber / 100;
TwoDigitOne = workingnumber % 100;
remains = (TwoDigitOne+TwoDigitTwo+TwoDigitThree+TwoDigitFour) % 26;
cDigit = 'A' + remains;
}