Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

 1. Declare an array of type int called mults_3 with 10 elements.  Use a for

ID: 3535142 • Letter: #

Question

Â

1. Declare an array of type int called mults_3 with 10 elements. Use a for loop to initialize the elements of the array to the values: 3, 6, 9, . . ., 30

Â

2. Declare an array of type char called stinfo and initialize it to the value "C is an interesting language". Declare a pointer variable stPtr for stinfo. Assign the pointer to the starting address of stinfo.

Â

Write code for each of the following:

Â

1. Create a double-precision floating-point array called daily_expenses which will hold 7 elements. Â Write the for loop statements necessary to read in 7 values from the keyboard and store them in the daily_expenses array.

Â

2. Write statements necessary to define a file pointer,fpOut, and use the pointer to open an existing sequential  file called †³PersonnelData.txt†³for writing additional records.

Explanation / Answer

Please rate with 5 stars :)


This is what you need :)


#include <iostream>

using namespace std;

main()

{

int i;

int mul[10];

int no=3;

for(i=1;i<=10;i++)

{

mul[i-1]=no*i;

}


char stinfo[10];

char *ptr=&stinfo;


double daily_expenses[7];

for(i=1;i<=10;i++)

{

cin >> daily_expenses[i-1];

}

}


I have put the code here:

http://ideone.com/yGmVYP