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

 

orion.a.smith@gmail.com apcsa-primitives > apcsaPrimitivesCents
prev  |  next  |  chance

Given a double input representing an amount of money, return just the number of cents in the currency, truncated if the double input has fractional cents. Precondition: input will be a non-negative number (no special values like infinity or NaN)


apcsaPrimitivesCents(0.55) → 55
apcsaPrimitivesCents(3.45) → 45
apcsaPrimitivesCents(4.444444) → 44

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

public int apcsaPrimitivesCents(double money) { }

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

Copyright Nick Parlante 2017 - privacy