Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need some help running this code. I can't get it to run. #include #include using namespace std; int getNumber(); string determineEvenOrOdd(int); string determinePositiveOrNegative(int); void

I need some help running this code. I can't get it to run.

#include #include using namespace std; int getNumber(); string determineEvenOrOdd(int); string determinePositiveOrNegative(int); void displayResults(int, string, string);

int main(void) { int Number = 0; string EvenOrOdd; string PositiveOrNegative; char repeat; Number = getNumber(); EvenOrOdd = determineEvenOrOdd(Number); PositiveOrNegative = determinePositiveOrNegative(Number); displayResults(Number, EvenOrOdd, PositiveOrNegative); cout << endl << endl; return 0; }

int getNumber() {

do { int Number; cout << "Please enter the number to be determined as even/odd or positive/negative: "; cin >> Number;

if (Number < -10000 || Number> 10000) cout << "The Number is Invalid "; return Number; } while if (Number < -10000 || Number> 10000)

}

string determineEvenOrOdd(int Number) { string EvenOrOdd;

if (Number % 2 = 0) EvenOrOdd = " Even"; else EvenOrOdd = "Odd"; return EvenOrOdd; } string determinePositiveOrNegative(int) { if (Number > 0) PositiveOrNegative = "Positive"; else PositiveOrNegative = "Negative"; return PositiveOrNegative;

} void displayResults(int, string, string) { cout << "The number you entered, " << Number << "is a" << PositiveOrNegative << "," << EvenOrOdd << "Value." << endl; cout << "Would you like to calculate the stats on another team? Y or N)"; cin >> repeat;

}while (repeat == 'Y' || repeat == 'y'); return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

Compare the different types of employee separation actions.

Answered: 1 week ago

Question

Assess alternative dispute resolution methods.

Answered: 1 week ago

Question

Distinguish between intrinsic and extrinsic rewards.

Answered: 1 week ago