Code:
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int sum;
int average;
double dec1;
double dec2;
double dec3;
double dec4;
double dec5;
cout << "Enter five decimal numbers: ";
cin >> dec1 >> dec2 >> dec3 >> dec4 >> dec5;
cout << endl;
cout << "The numbers you entered are: \n"
cout << dec1 << dec2 << dec3 << dec4 << dec5;
cout << endl;
double a = dec1
double b = dec2
double c = dec3
double d = dec4
double e = dec5
int h = nint(a);
int i = nint(b);
int j = nint(c);
int k = nint(d);
int l = nint(e);
sum = h + i + j + k + l;
average = (h + i + j + k + l) / 5
cout << endl;
cout << "Sum: " << sum << endl;
cout << "Average: " << average << endl;
return 0;
}
~~~ This is returning a lot of errors for me now. I hope you guys can see what this program is doing and can hopefully give me some advice.... there's probably a way to make it shorter, I just don't know how to do it! You guys have been a great help and I really appreciate it.