Chapter 7: Problem 3
(Write \(C++\) Statements) Write one or more statements that perform the following tasks for an array called fractions: a) Define a constant integer variable arraySize initialized to 10 b) Declare an array with arraySize elements of type double, and initialize the elements to 0 . c) Name the fourth element of the array. d) Refer to array element 4. c) Assign the value 1.667 to array element 9 f) Assign the value 3.333 to the seventh element of the array. g) Print array elements 6 and 9 with two digits of precision to the right of the decimal point, and show the output that is actually displayed on the screen. h) Print all the array elements using a for statement. Define the integer variable i as a control variable for the loop. Show the output.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.