Skip to content

Latest commit

 

History

History
37 lines (17 loc) · 1.55 KB

Challenges 31-40.md

File metadata and controls

37 lines (17 loc) · 1.55 KB

Challenges 31-40: "How long is a piece of string?"

  1. Write a subroutine to convert from hex to denary. YOU MAY NOT USE THE BUILT-IN FUNCTIONS.

  2. Write a subroutine that takes two 8 bit binary numbers and adds them together. It should return the result as an 8 bit binary number.

  3. Write a subroutine that will take two values as floats - the charge for a transaction and the amount tendered. Work out the change required and return a tuple or list that contains the number of each coin required to provide the correct change. You should aim to hand over the fewest number of coins that you can.

  4. Write a subroutine that accepts a number that represents a score in a test. Return the corresponding grade. Grades are calculated as E>10, D>25, C>50, B>70, A>85. A score of 10 or less is graded as U.

  5. Write a subroutine that takes a camel case string with no spaces and returns a string with each word seperated by spaces.
    E.g. "HelloWorld" > "Hello World".

  6. Write a subroutine that takes a lowercase sentence as input and returns a camel case string with no spaces.

  7. Ask the user for two words. Determine if they are anagrams of each other.

  8. Ask the user for two strings, strip out all punctuation (non letter characters). Also standardise the case (lower or upper) and return the new string.

  9. Ask the user for two sentences, strip out all punctuation and determine if the two strings are anagrams of each other.

  10. Ask the user for two sentences, strip out all punctuation and determine if the two strings are palindromes.