In this section, you are going to work using string methods and displaying various strings and numbers to the canvas and various string methods.
Write a sketch named section_12_1 .
The starter code is provided below.
Modify the starter code by implementing the splitAndShow function so that when this sketch is run, it displays a canvas like the one pictured.
splitAndShow accepts one parameter, a string representing a name.
The function should split the first name and last name and display them on the canvas separately, with two different colors.
|
Write a sketch named section_12_2 .
The starter code is provided below.
Modify the starter code by implementing the drawLastThree function so that when this sketch is run, it displays a canvas like the one pictured.
drawLastThree has three parameters: a string, an x-coordinate, and a y-coordinate.
This function should display the last three characters of the string at the x and y coordinates.
|
Write a sketch named section_12_3 .
The starter code is provided below.
Modify the starter code by implementing the drawMidThree function so that when this sketch is run, it displays a canvas like the one pictured.
drawMidThree has three parameters: a string, an x-coordinate, and a y-coordinate.
This function should display the middle three characters of the string at the x and y coordinates.
|
Write a sketch named section_12_4 .
The starter code is provided below.
Modify the starter code by implementing the drawEveryOther function so that when this sketch is run, it displays a canvas like the one pictured.
drawEveryThree has three parameters: a string, an x-coordinate, and a y-coordinate.
This function should display every-other character in the parameter string at the x and y coordinates.
|
Write a sketch named section_12_5 .
The starter code is provided below.
Modify the starter code by implementing the drawViwelCount function so that when this sketch is run, it displays a canvas like the one pictured.
drawVowelCount has three parameters: a string, an x-coordinate, and a y-coordinate.
This function should count the number of vowels in the input string, and display the count at the x and y coordinates.
|