Write a function that takes one argument of type double and that function returns the character value ‘P’ if its argument is positive and return ‘N’ if its argument is zero or negative?
Help please
Thank you Much :)
Write a function that takes one argument of type double and that function returns the character value ‘P’ if its argument is positive and return ‘N’ if its argument is zero or negative?
Help please
Thank you Much :)
Simple. Use C++. It should work just fine.
In order to determine if it is positive or negative, just use an if statement to compare that inputted double value to zero. The method that this is located in will return a type "char" and the return statements will be in your if condition statements.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.