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

 

andersoniii.edwin@cusd80.com > showSign
prev  |  next  |  chance

Write a method showSign(int nums) that receives an integer parameter and returns a String where the sign of the number is separated from the integer by one space. Only show one sign. If the value of nums is zero, then just return 0.


showSign(0) → "0"
showSign(10) → "+ 10"
showSign(-12) → "- 12"

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

public String showSign( int nums){ }

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: 110

Copyright Nick Parlante 2017 - privacy