Based on the given code below, complete tasks 1) and 2).
Notes: No need to write the main() function, just write the related statements.
vector A(10);
int sum = 0;
for (size_t i = 0; i < A.size(); i++) {
A[i] = i * 2;
}
1) Use a for-loop to find the sum of A.
2) Print out the average of A with two digits preserved after the decimal point.