Solution: Methods

Let's discuss the solution to the exercise.

We'll cover the following

Problem

This exercise creates a method to determine if a number is positive or negative. Create a console-based application for a PositiveOrNegative app that meets the requirements below:

  1. Write a method that receives an integer as an argument.
  2. The method should determine if a number is positive or negative.
  3. Display a message with the number and whether it’s positive, negative, or neither positive nor negative (zero).

Get hands-on with 1400+ tech skills courses.