Skip to main content
Contents Index
Search Book
Search Results:
No results.
Read aloud
Readability settings Prev Up Next Scratch ActiveCode Profile
title here
\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
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.