Introduction to arrays ---------------------- computer programs contain two fundamental elements: -Algerithm which dictates the flow and control through the program -Data structures which dictate how information is stored and organized by the program The fundamental concept of an arrey in C++ is that of a sequential collection of values, all of the same type, all accessed by the same variable name. Individual values in an arrey are individually accessed by using the array name and index (a number) to specify which value is being accessed. ------ int list[67]------an array of 67 integers. index from 0 to 66 char string[20]---an array of 20 characters. index from 0 to 19 float price[30]---an array of 30 floating points. index from 0 to 29 ------ ex: --- price[0] = 78.84; price[1] = 10.01; float total=price[0] + price[1]; total += price[29]; //adds the last value to total price[15] *= 2; //doubles the price of the 16th value cout << price[6] - price[8]; //displays the difference of two prices --------------------------------------- //simple array processing. #include void main(void) { int list[10]; //array of 10 integers int i; //used as an array index i = 0; //always starts at 0 for arrays while (i < 10) { cout <<"Enter a whole number for element" << i << " "; cin >> list[i]; i ++; } // summing the array i = 0; int total = 0; //to hold the array sum while (i < 10) { total += list[i]; i ++; } cout <<"The total of the value in the array is" << total << endl; } ---------------------------------------- *write a line of C++ code that would be equivalent to the following formula: p=2/3(a + n)^t --- //simple array processing. #include void main(void) { int a, n, t; float p; cout <<"enter a, n and t" << endl; cin >> a >> n >> t; p = 2/3(a + n)^t; cout <<"P is " << p << endl; }