← Unit 1 · all exercises
Saved in this browser only

Money in cents

Given a number of dollars and a number of cents, return the total in cents.

int totalCents(int dollars, int cents)

Solution.java
Loading editor…
Results

Examples

  • totalCents(3, 25) → 325
  • totalCents(0, 99) → 99

There are also 3 hidden tests you can't see. Solve the problem, not the examples.