Click here to Skip to main content
15,922,584 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSaving the file with date and time Pin
Rajiya8-Aug-06 20:41
Rajiya8-Aug-06 20:41 
AnswerRe: Saving the file with date and time Pin
Amar Sutar8-Aug-06 20:50
Amar Sutar8-Aug-06 20:50 
AnswerRe: Saving the file with date and time Pin
Hamid_RT8-Aug-06 21:51
Hamid_RT8-Aug-06 21:51 
Questionany ideas to reduce log file size or make log file size managed? Pin
George_George8-Aug-06 20:35
George_George8-Aug-06 20:35 
AnswerRe: any ideas to reduce log file size or make log file size managed? Pin
Hamid_RT8-Aug-06 20:58
Hamid_RT8-Aug-06 20:58 
GeneralRe: any ideas to reduce log file size or make log file size managed? Pin
George_George8-Aug-06 21:36
George_George8-Aug-06 21:36 
QuestionXML Programming in VC++.net Pin
Sarvan AL8-Aug-06 20:27
Sarvan AL8-Aug-06 20:27 
AnswerRe: XML Programming in VC++.net Pin
Hamid_RT8-Aug-06 20:48
Hamid_RT8-Aug-06 20:48 
GeneralRe: XML Programming in VC++.net ___Thank you Pin
Sarvan AL8-Aug-06 21:04
Sarvan AL8-Aug-06 21:04 
QuestionXLL Development : Adding Rows in Excel Sheet using VC++ Pin
sakings998-Aug-06 20:07
sakings998-Aug-06 20:07 
AnswerRe: XLL Development : Adding Rows in Excel Sheet using VC++ Pin
Hamid_RT8-Aug-06 21:13
Hamid_RT8-Aug-06 21:13 
QuestionSmart GDI class that implements RAII Pin
min_2_max8-Aug-06 20:05
min_2_max8-Aug-06 20:05 
QuestionRe: Smart GDI class that implements RAII Pin
Hamid_RT8-Aug-06 20:53
Hamid_RT8-Aug-06 20:53 
Questiontabctrl and manifest Pin
locoone8-Aug-06 17:36
locoone8-Aug-06 17:36 
QuestionCount number of open documents in MDI [modified] Pin
clintalt8-Aug-06 16:44
clintalt8-Aug-06 16:44 
AnswerRe: Count number of open documents in MDI Pin
Viorel.8-Aug-06 21:36
Viorel.8-Aug-06 21:36 
QuestionHow to add menu to other applications Pin
Dody_DK8-Aug-06 12:37
Dody_DK8-Aug-06 12:37 
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

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.