Question
Twelve VERY quick questions. Answer all to receive positive rate since they are very short. IF any are skipped, I will rate negatively. 1. [
Twelve VERY quick questions. Answer all to receive positive rate since they are very short. IF any are skipped, I will rate negatively.
1. [ A program refers to any one of these elements with an array-access expression that includes the name of the array followed by the index of the particular element in square brackets ([]).] .
T or F? The [] syntax is not a bona fide Java operator.
2. [259:7 An index must be an int value or a value of a type that can be promoted to intnamely, byte, short, or char, but not long] Why do you think the long type is not allowed?
3. T or F? An array containing primitive-type elements is also considered a primitive type.
4. Define a reference to a 6-by-6 array of int named rolls.
5. Write an expression using the array instance variable length that computes to be the index value of the last element of the 1-dimensional array named A1.
6. (Continuing 5) Write an expression using the array instance variable length that computes to be the index value of the last element in the last row of the 2-dimensional array named A2.
7. When int [] A1 = { 0,1,2,3,0 }; what is A1.length? ______
8. Define a constant variable (also called a named constant) named PI initialized with the value 3.14159.
9. Develop a static method named Sum1() that sums the elements of the 1-dimensional int array named A1 that is passed as the methods only parameter. Note You must use A1s length instance variable.
10. (Continuing 9) Re-write Sum1() using an enhanced for-statement.
11. (Continuing 9 and 10) T or F? The enhanced for-statement is just as powerful as the old-fashioned length-controlled for-statement.
12. What does printf("%03d %3d",12,34); output?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started