- Jun 13, 2006
- 630
- 0
- 0
I am currently a senior taking a c++ online class, working out of textbook. I am stuck on this one project and I am seeking help on it.
so here is the project
"write a program that asks the user for a series of integers one at a time. When the user enters the integer 0, the program displays the following info.:
-the number of integers in the series ( not including 0)
- average of the integers
-largest integer in the series
-smallest in the series
- difference between the largest and smallest."
heres what I got so far
"
#include<iostream.h>
main()
{
int number, average, largest, smallest, difference = 0;
int i;
do
{
cout << " enter a number";
cin >> i;
if (i == 0)
{
cout << "The number of integers in the series" << number << endl;
cout << "The average of the integers" << average << endl;
cout << "The largest integer in the series" << largest << endl;
cout << "The smallest integer in the series" << smallest << endl;
cout << "The difference between the largest and smallest integer in the series" << differece << endl;
{break;}
}
}
while (1);
system("pause");
return 0;
"
Thank you for your help
so here is the project
"write a program that asks the user for a series of integers one at a time. When the user enters the integer 0, the program displays the following info.:
-the number of integers in the series ( not including 0)
- average of the integers
-largest integer in the series
-smallest in the series
- difference between the largest and smallest."
heres what I got so far
"
#include<iostream.h>
main()
{
int number, average, largest, smallest, difference = 0;
int i;
do
{
cout << " enter a number";
cin >> i;
if (i == 0)
{
cout << "The number of integers in the series" << number << endl;
cout << "The average of the integers" << average << endl;
cout << "The largest integer in the series" << largest << endl;
cout << "The smallest integer in the series" << smallest << endl;
cout << "The difference between the largest and smallest integer in the series" << differece << endl;
{break;}
}
}
while (1);
system("pause");
return 0;
"
Thank you for your help