[ Team LiB ] Previous Section Next Section

Exercises

  1. Create a function that works with two arguments. The first argument should be a username, and the second should be an email address. Use case conversion functions to capitalize the first letter of the username. Convert the email address to lowercase characters and check that it contains the @ sign. If you can't find the @ character, return false; otherwise, return an array containing the converted arguments. Test the function.

  2. Create an array of doubles and integers. Loop through the array converting each element to a floating-point number with a precision of 2. Right-align the output within a field of 20 characters.

    [ Team LiB ] Previous Section Next Section