Click here to Skip to main content
14,665,452 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to add menu to other applications Pin
Hamid_RT8-Aug-06 21:22
MemberHamid_RT8-Aug-06 21:22 
GeneralRe: How to add menu to other applications Pin
Dody_DK9-Aug-06 2:14
MemberDody_DK9-Aug-06 2:14 
GeneralRe: How to add menu to other applications Pin
Hamid_RT9-Aug-06 5:52
MemberHamid_RT9-Aug-06 5:52 
GeneralRe: How to add menu to other applications Pin
Dody_DK9-Aug-06 8:05
MemberDody_DK9-Aug-06 8:05 
GeneralRe: How to add menu to other applications Pin
Hamid_RT9-Aug-06 22:31
MemberHamid_RT9-Aug-06 22:31 
Questionc++ Project help asap Pin
klck20008-Aug-06 10:47
Memberklck20008-Aug-06 10:47 
QuestionRe: c++ Project help asap Pin
David Crow8-Aug-06 10:51
MemberDavid Crow8-Aug-06 10:51 
AnswerRe: c++ Project help asap Pin
klck20008-Aug-06 10:58
Memberklck20008-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
MemberDavid Crow8-Aug-06 11:08 
GeneralRe: c++ Project help asap Pin
klck20008-Aug-06 11:16
Memberklck20008-Aug-06 11:16 
GeneralRe: c++ Project help asap [modified] Pin
markkuk8-Aug-06 11:40
Membermarkkuk8-Aug-06 11:40 
GeneralRe: c++ Project help asap Pin
klck20008-Aug-06 11:47
Memberklck20008-Aug-06 11:47 
GeneralRe: c++ Project help asap Pin
David Crow9-Aug-06 3:08
MemberDavid Crow9-Aug-06 3:08 
GeneralRe: c++ Project help asap Pin
klck20009-Aug-06 3:33
Memberklck20009-Aug-06 3:33 
GeneralRe: c++ Project help asap Pin
David Crow9-Aug-06 4:55
MemberDavid Crow9-Aug-06 4:55 
GeneralRe: c++ Project help asap Pin
klck20009-Aug-06 5:00
Memberklck20009-Aug-06 5:00 
GeneralRe: c++ Project help asap Pin
David Crow9-Aug-06 5:06
MemberDavid Crow9-Aug-06 5:06 
GeneralRe: c++ Project help asap Pin
klck20009-Aug-06 5:10
Memberklck20009-Aug-06 5:10 
QuestionRe: c++ Project help asap Pin
David Crow6-Oct-06 10:01
MemberDavid Crow6-Oct-06 10:01 
QuestionGlobal variables crashing my app Pin
Wheatbread8-Aug-06 9:51
MemberWheatbread8-Aug-06 9:51 
AnswerRe: Global variables crashing my app Pin
Cedric Moonen8-Aug-06 20:26
MemberCedric Moonen8-Aug-06 20:26 
QuestionCommunication between MainFrm and Document [modified] Pin
titaniumdecoy8-Aug-06 9:41
Membertitaniumdecoy8-Aug-06 9:41 
AnswerRe: Communication between MainFrm and Document Pin
Kiran Pinjala8-Aug-06 21:51
MemberKiran Pinjala8-Aug-06 21:51 
QuestionPOSTing to Multiple Http Forms Pin
EpicYeti8-Aug-06 9:20
MemberEpicYeti8-Aug-06 9:20 
AnswerRe: POSTing to Multiple Http Forms Pin
led mike8-Aug-06 10:43
Memberled 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.