Getting ready for next Thursday
Here are a few things we have done in class you should be able to do.
And here are some small problems you should be able to do.
Declare an array of characters called
lowerCaseso that it can contains 26 characters. Store the letters
'z'in the elements of
In a single statement, declare and initalize an array of characters called
vowelsthat contains the five vowels.
Using the documentation of the Java
Stringclass as a reference, write Java code to do the following actions.
In a single statement create a
sthat contains the characters, in order, contained in the
Determine the number of characters in a
substringto create a
Stringwhich is the first ten digits of π. Use the
Mathclass to obtain the value of π.
Write a program that reads a series of integers from the terminal. When a negative number is entered, the program should stop reading numbers and print the sum of all the numbers that have been entered.
Write a method that is passed an array of integers and returns the average value of the numbers in the array.
Write a single for loop that prints, in order, all the even integers of an array until the either all the array’s integers have been added or a negative number is found within the array.
Write a small section of code that can, given a
sof the form
"2/21/13"to represent February 21, 2013, prints the month, day, and year encoded in