Dollars To Cents

Challenge image cover: Dollars To Cents
  • HTML
  • CSS
  • JS

Difficulty:Easy

Converting dollars to cents would enable you to practice your fundamental knowledge of programming. Loops, if conditions and a simple algorithm will be used. Your task is to let the user input a dollar value (float), assuming that it can also accept extra cents (ex. $2.75), and convert it into an integer (in this case, if $2.75 = 275). After this, convert into coins with the sub-type of dollars: penny, nickel, dime and quarter. Use an algorithm that would divide the dollar value to the four coin types, and output few coins as possible.

The challenge: Try this without using any frameworks.

(EX. If you have $0.58, I would have 4 coins: 2 quarters, 0 dimes, 1 nickel and 3 pennies)

User Stories

  • User can enter a dollar value
  • User can see the total cents from the converted dollar value

Bonus features

  • User can see how many were pennies, nickels, quarters and dimes from the total cents

Example projects

More Challenges

Bin2Dec challenge image
  • HTML
  • CSS
  • JS

Difficulty:Easy

Convert binary numbers (up to 8 digits) to decimal effortlessly, providing validation and insights into binary arithmetic concepts.

Calculator challenge image
  • HTML
  • CSS
  • JS

Difficulty:Easy

Create a functional calculator for basic arithmetic with a user-friendly interface, supporting clear operations and error handling.

Border-radius Previewer challenge image
  • HTML
  • CSS
  • JS

Difficulty:Easy

Tool to view, customize and copy CSS border-radius properties, creating simple or complex shapes easily.

See more >