id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > quiz2023_09_15_APP1SLHL_posNegZero
prev  |  next  |  chance

Write a method that returns one of the strings "positive", "negative", or "zero" depending on what sign the value of 'num' has. For example, if 'num' is any negative number, return "negative". If 'num' is any positive number, return "positive". If 'num' is neither positive nor negative, return "zero". Look at the test data for examples.


quiz2023_09_15_APP1SLHL_posNegZero(7) → "positive"
quiz2023_09_15_APP1SLHL_posNegZero(0) → "zero"
quiz2023_09_15_APP1SLHL_posNegZero(-3) → "negative"

...Save, Compile, Run (ctrl-enter)

public String quiz2023_09_15_APP1SLHL_posNegZero(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 210

Copyright Nick Parlante 2017 - privacy