Skip to main content

Section 1.21 Toggle Code Practice 1b (1.7-1.15)

For each of the coding problems below, write your own solution. If you get stuck, click the Get Help button for a personalized mixed-up code problem built from your current attempt.

Activity 1.21.1.

Write code that prints a random number from 1 to 50.

Activity 1.21.2.

Write code that prints the first 2 characters of the message followed by the last 2 characters of the message using the appropriate String methods.

Activity 1.21.3.

Write code that prints the first letters in first, middle, and last in lowercase letters using the appropriate String methods.

Activity 1.21.4.

Write code that prints the message in all uppercase letters using the appropriate String methods.

Activity 1.21.5.

Write code that prints the first 3 letters of the message in uppercase letters using the appropriate String methods.

Activity 1.21.6.

Write code that print the part of the message starting with the word β€œnice” using the appropriate String methods.
You have attempted of activities on this page.