B
begum
i write a program about finding the max value of a subseqence in a
given sequence. i write but i finf lots of syntax mistakes and i
can't do them in correct. please help me.
Thanks;
Begum
here is the program
#include <iostream>
#include <conio.h>
#include <iomanip.h>
#pragma hdrstop
template <class someType>
class Sum
{
private:
someType arr[100];
public:
void add();
void get_sequence();
};
template <class someType>
void Sum<sumType>::add()
{
int i;
cout<<"****PLEASE GIVE A SUBSEQUENCE WHICH IS TO FIND THE MAX.
VALUE ****\n"<<endl;
cin>>"%d",&d>>endl;
}
template <class someType>
void Sum<sumType>::get_sequence()
{
int maxSum=0;
int thisSum=0;
int j;
for (j=0; j<101; j++)
{
thisSum +=a[j];
if (thisSum > maxSum)
{
maxSum = thisSum;
}
else if (thisSum < 0)
{
thisSum=0;
}
return maxSum;
}
}
void main ()
{
void add();
void get_sequence();
}
given sequence. i write but i finf lots of syntax mistakes and i
can't do them in correct. please help me.
Thanks;
Begum
here is the program
#include <iostream>
#include <conio.h>
#include <iomanip.h>
#pragma hdrstop
template <class someType>
class Sum
{
private:
someType arr[100];
public:
void add();
void get_sequence();
};
template <class someType>
void Sum<sumType>::add()
{
int i;
cout<<"****PLEASE GIVE A SUBSEQUENCE WHICH IS TO FIND THE MAX.
VALUE ****\n"<<endl;
cin>>"%d",&d>>endl;
}
template <class someType>
void Sum<sumType>::get_sequence()
{
int maxSum=0;
int thisSum=0;
int j;
for (j=0; j<101; j++)
{
thisSum +=a[j];
if (thisSum > maxSum)
{
maxSum = thisSum;
}
else if (thisSum < 0)
{
thisSum=0;
}
return maxSum;
}
}
void main ()
{
void add();
void get_sequence();
}