PLS CHECK THE PROGRAM nd correct it - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

PLS CHECK THE PROGRAM nd correct it

coolbuddycoolbuddy Posts: 20Member

THE QUESTION OF THIS PROGRAM HAS BEEN POSTED UNDER THE TOPIC
QUESTION PLZ HELP ME...C++ ADT

/* Program used to compute some statistics of similarity
Standard deviation stdev:
sqrt(( sum of the square of each term - square of mean )/(n-1))
USE MOSS.CPP
-----------------------------------------------------
/*Declaring and initialsing variables*/
#include
#include
#include
#include
#include "Moss.h"
using namespace std;

/*Main function*/
int main()
{
Moss temp;
temp.input_values();
temp.calc();
temp.output_values();

return 0;
}

/*End of program*/

MOSS.CPP
===========================================

#include "Moss.h"
#include
#include
#include

void Moss::input_values()
{
/*Implementing vectors*/
int dummy;
string s;

getline(cin,s,'(');
cin>>dummy;
p1.push_back(dummy);

getline(cin,s,'(');
cin>>dummy;
p2.push_back(dummy);

getline(cin,s,' ');
cin>>dummy;
nline.push_back(dummy);

cout<<p1[0]<<p2[0]<<nline[0];
int n;
cin>>n;
}

/*End*/
MOSS.H
-------------------------------------------

// File: Moss.h
#include
using namespace std;
class Moss {

/*Declaring private and public functions of a class*/
private:
vector p1,p2,nline;

public:
void input_values();
void calc();
void output_values();

};



Comments

  • creeshnacreeshna Posts: 4Member
    :
    : THE QUESTION OF THIS PROGRAM HAS BEEN POSTED UNDER THE TOPIC
    : QUESTION PLZ HELP ME...C++ ADT
    :
    : /* Program used to compute some statistics of similarity
    : Standard deviation stdev:
    : sqrt(( sum of the square of each term - square of mean )/(n-1))
    : USE MOSS.CPP
    : -----------------------------------------------------
    : /*Declaring and initialsing variables*/
    : #include
    : #include
    : #include
    : #include
    : #include "Moss.h"
    : using namespace std;
    :
    : /*Main function*/
    : int main()
    : {
    : Moss temp;
    : temp.input_values();
    : temp.calc();
    : temp.output_values();
    :
    : return 0;
    : }
    :
    : /*End of program*/
    :
    : MOSS.CPP
    : ===========================================
    :
    : #include "Moss.h"
    : #include
    : #include
    : #include
    :
    : void Moss::input_values()
    : {
    : /*Implementing vectors*/
    : int dummy;
    : string s;
    :
    : getline(cin,s,'(');
    : cin>>dummy;
    : p1.push_back(dummy);
    :
    : getline(cin,s,'(');
    : cin>>dummy;
    : p2.push_back(dummy);
    :
    : getline(cin,s,' ');
    : cin>>dummy;
    : nline.push_back(dummy);
    :
    : cout<<p1[0]<<p2[0]<<nline[0];
    : int n;
    : cin>>n;
    : }
    :
    : /*End*/
    : MOSS.H
    : -------------------------------------------
    :
    : // File: Moss.h
    : #include
    : using namespace std;
    : class Moss {
    :
    : /*Declaring private and public functions of a class*/
    : private:
    : vector p1,p2,nline;
    :
    : public:
    : void input_values();
    : void calc();
    : void output_values();
    :
    : };
    :
    :
    :
    :

    wheres the implementation for calc() and output_values()? if you dont intend to do nothing, shouldnt you atleast put the skeletons out there, for the project to atleast link?

    after adding

    void Moss::calc()
    {
    }

    void Moss::output_values()
    {
    }

    the program compiled and linked...add what you need to do in either of the methods and you should be good, for the time being.
Sign In or Register to comment.