ICT 214 Tutorial Week 2

  1. Using the number operators / and %, print an integer (with value less than 512) as a string of three octal digits
  2. Given a string of characters containing three octal digits, convert it to an integer, using the String method charAt(), and converting a char to a number by subtracting 60: n = ch - '0'
  3. Use the format method of String to convert an octal number (e.g. 020) to a decimal string
  4. Use the method Integer.parseInt(String s, int radix) to convert a string containing an octal number to an integer
  5. Complete the program to turn an IP dotted address into a 32-bit integer
  6. Write a program to turn a 32-bit integer into a string containing an IP dotted address

Jan Newmarch (http://jan.newmarch.name)
Last modified: Tue Feb 26 09:13:55 EST 2008
Copyright ©Jan Newmarch