this is the first piece I have to look at but I dont underst


this is the first piece I have to look at. but I don\'t understand #21. please show how


Solution

#include <iostream>
#include <iomanip>
/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */
using namespace std;

int main(int argc, char** argv) {
   double price[10]={96.5,100.5,100.5,100.5,99,99,99,100,98.5,98.9};
   double total = 0.0;
   double average = 0.0;
  
   for(int i=0;i<10;i++)
   {
       total = total + price[i];
   }
   average = total / 10;
   cout << fixed <<setprecision(2);
   cout << \"Average stock price:$\" << average <<endl;
   return 0;
}

 this is the first piece I have to look at. but I don\'t understand #21. please show how Solution#include <iostream> #include <iomanip> /* run this

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site