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

 

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

Write a method that returns the decimal equivalent of the hexadecimal number represented by the string 'hex'. As preconditions you may assume that 'hex' only contains the symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. You may also assume that 'hex', when converted to decimal, is less than the maximum possible integer value. If 'hex' is an empty string, return zero.


quiz2022_03_01_HL_hexToDec("") → 0
quiz2022_03_01_HL_hexToDec("0") → 0
quiz2022_03_01_HL_hexToDec("A000") → 40960

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

public int quiz2022_03_01_HL_hexToDec(String hex) { }

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