# Toggle Code Practice 1b (1.7-1.15)

Each coding exercise has its own folder. Open its `.java` file and press **Run** to try it. **Run Tests** checks every graded exercise in this lesson at once.

For each of the coding problems below, write your own solution.

## Exercise 1

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

> Open the `01-u1b-toggle1` folder and edit `Test1.java`. Press **Run** to try it; **Run Tests** checks it (5 tests).

## Exercise 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.

> Open the `02-u1b-toggle2` folder and edit `Test1.java`. Press **Run** to try it; **Run Tests** checks it (3 tests).

## Exercise 3

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

> Open the `03-u1b-toggle3` folder and edit `Test1.java`. Press **Run** to try it; **Run Tests** checks it (1 test).

## Exercise 4

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

> Open the `04-u1b-toggle4` folder and edit `Test1.java`. Press **Run** to try it; **Run Tests** checks it (1 test).

## Exercise 5

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

> Open the `05-u1b-toggle5` folder and edit `Test1.java`. Press **Run** to try it; **Run Tests** checks it (1 test).

## Exercise 6

Write code that print the part of the message starting with the word “nice” using the appropriate String methods.

> Open the `06-u1b-toggle6` folder and edit `Test1.java`. Press **Run** to try it; **Run Tests** checks it (1 test).
