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
lowerCase. InitializelowerCaseso that it can contains 26 characters. Store the letters'a'to'z'in the elements oflowerCase.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
Stringsthat contains the characters, in order, contained in thechararrayb.Determine the number of characters in a
Strings.Use the
Stringstatic methodvalueOfand theStringinstance methodsubstringto create aStringwhich is the first ten digits of π. Use theMathclass 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
Stringsof the form"2/21/13"to represent February 21, 2013, prints the month, day, and year encoded ins.