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

 

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

We will define a number to be "sad", "happy" or "ecstatic" based on the digits of its base-4 representation. If none of these digits in base-4 are 3's the number is sad. If at least one of these digits is a 3 the number is happy. But if ALL the digits in base-4 are 3's the number is ecstatic. Return the correct string based on the positive integer input parameter. See test data for examples.


baseFourSunflowerNumberAustralia(15) → "ecstatic"
baseFourSunflowerNumberAustralia(13) → "happy"
baseFourSunflowerNumberAustralia(2312) → "sad"

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

public String baseFourSunflowerNumberAustralia(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: 290

Copyright Nick Parlante 2017 - privacy