x.Hm adjust this program so it meets fufill the requirements of these comments?
ID: 3618404 • Letter: X
Question
x.Hm adjust this program so it meets fufill the requirements of these comments? YOU MUST HAVE 2 FUNCTIONS, BANNER AND sum()// YOUR PROGRAM GIVES NODIRECTIONS TO THE USER ABOUT WHAT IS TO
// DONE. THE USE USER MUSTBE TOLD WHAT TO DO!
// YOU HAVE NOT INCLUDED ANY OUTPUT IN THE SOURCEPROGRAM.
// YOU MUST MEET EVERY ITEM IN THE PROGRAM REQUIREMENTS.
// THEsums(...) FUNCTION WORKS WELL.
// CLEAN UP THE PROGRAM AND MAKE IT APROPER APPLICATION PROGRAM.
The program has to be user friendly. If you need more guidance, this is the link for the original question. /answers-apr-10/computer-science/c-help-will-rate-lifesaver-i-need-help-with-this-project-i-need-as-much-commentary-as_829072.aspx #include<iostream>
#include<iomanip>
using namespace std;
void sums(int[],int);
int main()
{int n,i;
cout<<"Enter the number to add to: ";
cin>>n;
while(n>1000)
{cout<<"number must be <=1000 "; //number must be <=1000 if not give error message and
cout<<"Enter the number to add to: "; //ask for new number
cin>>n;
}
int sum[n]; //allocate array for correct size
sums(sum,n); //fill in array in function
cout<<"number running total ";
for(i=1;i<=n;i++) //print the running totals
cout<<setw(5)<<i<<setw(12)<<sum[i]<<endl;
system("pause");
return 0;
}
void sums(int sum[],int n)
{int i;
sum[0]=0; YOU MUST HAVE 2 FUNCTIONS, BANNER AND sum()
// YOUR PROGRAM GIVES NODIRECTIONS TO THE USER ABOUT WHAT IS TO
// DONE. THE USE USER MUSTBE TOLD WHAT TO DO!
// YOU HAVE NOT INCLUDED ANY OUTPUT IN THE SOURCEPROGRAM.
// YOU MUST MEET EVERY ITEM IN THE PROGRAM REQUIREMENTS.
// THEsums(...) FUNCTION WORKS WELL.
// CLEAN UP THE PROGRAM AND MAKE IT APROPER APPLICATION PROGRAM.
The program has to be user friendly. If you need more guidance, this is the link for the original question. /answers-apr-10/computer-science/c-help-will-rate-lifesaver-i-need-help-with-this-project-i-need-as-much-commentary-as_829072.aspx #include<iostream>
#include<iomanip>
using namespace std;
void sums(int[],int);
int main()
{int n,i;
cout<<"Enter the number to add to: ";
cin>>n;
while(n>1000)
{cout<<"number must be <=1000 "; //number must be <=1000 if not give error message and
cout<<"Enter the number to add to: "; //ask for new number
cin>>n;
}
int sum[n]; //allocate array for correct size
sums(sum,n); //fill in array in function
cout<<"number running total ";
for(i=1;i<=n;i++) //print the running totals
cout<<setw(5)<<i<<setw(12)<<sum[i]<<endl;
system("pause");
return 0;
}
void sums(int sum[],int n)
{int i;
sum[0]=0;
Explanation / Answer
please rate-thanks by a banner, I assume you mean instructions the rest, sounds like you submitted it without a sample run #include #include using namespace std; void sums(int[],int); void banner(); int main() {int n,i; banner(); coutn; while(n>1000) {coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.