Perform the following tasks for an array called fractions: a) Declare constant ArraySize initialized to 10. b)

Question:

Perform the following tasks for an array called fractions:

a) Declare constant ArraySize initialized to 10.

b) Declare variable fractions which will reference an array with ArraySize elements of type double. Initialize the elements to 0.

c) Name the element of the array with index 3.

d) Assign the value 1.667 to the array element with index 9.

e) Assign the value 3.333 to the array element with index 6.

f) Sum all the elements of the array, using a for statement. Declare integer variable x as a control variable for the loop.

g) Sum all the elements of the array, using a foreach statement. Declare double variable element as a control variable for the loop.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Visual C# How to Program

ISBN: 978-0134601540

6th edition

Authors: Paul J. Deitel, Harvey Deitel

Question Posted: