Tuesday, July 28, 2009

C++ help computer science. i worked some of it. but i am stuck.?

#include %26lt;iostream.h%26gt;


#include %26lt;stdlib.h%26gt;


using namespace std;


int getstockprices;


float printAverage;


float printLowest;


float printhighest;


int main()


{


int stockprice;


float average;


float lowest;


float highest;


cout%26lt;%26lt; "Please enter the closign stock price for day 1."%26lt;%26lt; endl;


cin%26gt;%26gt; stockprice;


for (int day =1; day %26lt;=31; day++)


system("PAUSE");


return 0;


I am stuck please help.write, i tried running it but it doesn't continue to ask for day 2, and conti


compile and run a C++ program with proper style and functions to read 31days worth of closing stock prices from a user. After accepting 31days worth of stock prices the program will output:


. the highest price and the day of the month that price was reached


. the lowest price and the day of the month that price was reached


. the average price of the month.


the following functions are recommended;


get stock prices(stockprice);


print average (stockprice);


printlowest(stockprice);


printhighest(stockprice

C++ help computer science. i worked some of it. but i am stuck.?
Here's a portion/sample:





void get_stock_price(float %26amp;stockprice)


{


cout%26lt;%26lt; "Please enter the closing stock price for day 1."%26lt;%26lt; endl;


cin%26gt;%26gt; stockprice;


}








int main()


{


float stockprice;





get_stock_price(stockprice);


cout %26lt;%26lt; "1st price: " %26lt;%26lt; stockprice %26lt;%26lt; endl;





return 0;


}


No comments:

Post a Comment