9.4

February 19, 2008 rita1012

1. Declare and instantiate array variables for the following data:– double[] abc = new double[15]     string[] abcd = new string[20] 2. What is an initializer list? – It is another way to initialize the array, it assign the exact values to the array’s element. 3. Use an initializer list to create the following arrays:a. five test scores of 100, 90, 75, 60, and 88.    int [] aaa = {100, 90, 75, 60, 88}b. three interest rates of 0.12, 0.05, and 0.15    double[] bbb = {0.12, 0.05, 0.15}c. two strings, your first name and last name   string[] ccc = {david, chen} 4. Why is it better to use the form <type> [] <variable> instead of <type> <variable>[] when declaring an array variable. – It’s more confusing.  


 

Entry Filed under: Uncategorized

Leave a Comment

Required

Required, hidden



Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to comments via RSS Feed

Pages

Categories

Calendar

February 2008
M T W T F S S
« Jan   Apr »
 123
45678910
11121314151617
18192021222324
2526272829  

Most Recent Posts