Click here to Skip to main content
15,891,253 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to add menu to other applications Pin
Hamid_RT8-Aug-06 21:22
Hamid_RT8-Aug-06 21:22 
GeneralRe: How to add menu to other applications Pin
Dody_DK9-Aug-06 2:14
Dody_DK9-Aug-06 2:14 
GeneralRe: How to add menu to other applications Pin
Hamid_RT9-Aug-06 5:52
Hamid_RT9-Aug-06 5:52 
GeneralRe: How to add menu to other applications Pin
Dody_DK9-Aug-06 8:05
Dody_DK9-Aug-06 8:05 
GeneralRe: How to add menu to other applications Pin
Hamid_RT9-Aug-06 22:31
Hamid_RT9-Aug-06 22:31 
Questionc++ Project help asap Pin
klck20008-Aug-06 10:47
klck20008-Aug-06 10:47 
QuestionRe: c++ Project help asap Pin
David Crow8-Aug-06 10:51
David Crow8-Aug-06 10:51 
AnswerRe: c++ Project help asap Pin
klck20008-Aug-06 10:58
klck20008-Aug-06 10:58 
tell you the truth,im having a problem with everything,i dont know where to start.i just dont know how to do it,iv tried but get nothing but errors.can you help??heres my main class:

#include <iostream>


//#include "main.h"

using namespace std;

#include "main.h"

int main(){

Calcs calcs("input.dat");


cout << "Mean is " << calcs.findMeanHeight() << "\n";

cout << "Standard deviation in height is " << calcs.findStandardDeviation() << "\n";

heres my calcs class to get the mean etc:

#include <fstream>
#include <cmath>
using namespace std;

#include "calcs.h"

Calcs:: Calcs(string filename){
ifstream ifile("input.dat");
/*ifile >> _dimension;
for (int i=0; i<_dimension; i++){
for (int j=0; j<_dimension; j++)
ifile >> _heights[i][j];
}
}

void Calcs::print(ostream& s) const {
for (int i=0; i<_dimension; i++){
for (int j=0; j<_dimension; j++)
s << _heights[i][j] << " ";
s << "\n";
}
*/
}


double Calcs::findMeanHeight() const {
double runningMean=0;
for (int i=0; i<_dimension; i++)
for (int j=0; j<_dimension; j++)
runningMean+=_heights[i][j]/(pow(_dimension,2.0));
return runningMean;
}

double Calcs::findStandardDeviation() const{
// return standard deviation of heights
double squareOfMeans = pow(findMeanHeight(),2.0);
return sqrt(meanOfSquares()-squareOfMeans);
}
}
}
}

double Calcs::meanOfSquares() const{
double runningMean=0;
for (int i=0; i<_dimension; i++)
for (int j=0; j<_dimension; j++)
runningMean+=pow(_heights[i][j],2.0)/pow(_dimension,2.0);
return runningMean;
}
PLEASE HELP!!

klck2000

GeneralRe: c++ Project help asap Pin
David Crow8-Aug-06 11:08
David Crow8-Aug-06 11:08 
GeneralRe: c++ Project help asap Pin
klck20008-Aug-06 11:16
klck20008-Aug-06 11:16 
GeneralRe: c++ Project help asap [modified] Pin
markkuk8-Aug-06 11:40
markkuk8-Aug-06 11:40 
GeneralRe: c++ Project help asap Pin
klck20008-Aug-06 11:47
klck20008-Aug-06 11:47 
GeneralRe: c++ Project help asap Pin
David Crow9-Aug-06 3:08
David Crow9-Aug-06 3:08 
GeneralRe: c++ Project help asap Pin
klck20009-Aug-06 3:33
klck20009-Aug-06 3:33 
GeneralRe: c++ Project help asap Pin
David Crow9-Aug-06 4:55
David Crow9-Aug-06 4:55 
GeneralRe: c++ Project help asap Pin
klck20009-Aug-06 5:00
klck20009-Aug-06 5:00 
GeneralRe: c++ Project help asap Pin
David Crow9-Aug-06 5:06
David Crow9-Aug-06 5:06 
GeneralRe: c++ Project help asap Pin
klck20009-Aug-06 5:10
klck20009-Aug-06 5:10 
QuestionRe: c++ Project help asap Pin
David Crow6-Oct-06 10:01
David Crow6-Oct-06 10:01 
QuestionGlobal variables crashing my app Pin
Wheatbread8-Aug-06 9:51
Wheatbread8-Aug-06 9:51 
AnswerRe: Global variables crashing my app Pin
Cedric Moonen8-Aug-06 20:26
Cedric Moonen8-Aug-06 20:26 
QuestionCommunication between MainFrm and Document [modified] Pin
titaniumdecoy8-Aug-06 9:41
titaniumdecoy8-Aug-06 9:41 
AnswerRe: Communication between MainFrm and Document Pin
Kiran Pinjala8-Aug-06 21:51
Kiran Pinjala8-Aug-06 21:51 
QuestionPOSTing to Multiple Http Forms Pin
EpicYeti8-Aug-06 9:20
EpicYeti8-Aug-06 9:20 
AnswerRe: POSTing to Multiple Http Forms Pin
led mike8-Aug-06 10:43
led mike8-Aug-06 10:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.