Im trying my best but I keep gettting this Error. Somebody please Help me. Its error C2447: '{' : missing function header (old-style formal list?)
Im New to C++ I really need Help, Let me know if Im on the right track with my HomeWork Please!!!Write an interactive C++ program that prompts the user for ten (10) real numbers and calculate the sum, average, and prints the result. Hint: you may use an array to store the data.
Program requirements:
- The program must contain a class in which all the required private and public identifiers and the following functions must be defined.
- The program must contain three or more functions using parameters. These functions should read the data, calculate the sum, find the average, and print the results.
CPP / C++ / C Code:
#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[]);
{
{
class real
double n[10],s;
int i;
double avg;
}
public:
real()
{
s=0;
}
void read()
{
for (i=0;i<10;i++)
{
cout<<"Enter a number :";
cin>>n;
}
}
void print()
{
cout<<"The numbers entered are :"<<endl;
for (i=0;i<10;i++)
{
cout<<n<<endl;
}
}
void sum()
{
for (i=0;i<10;i++)
s=s+n;
}
void average()
{
avg=s/10;
}
void printres()
{
cout<<"Sum ="<<s<<endl;
cout<<"Average ="<<avg<<endl;
}