| | |
I need to help
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 3
Reputation:
Solved Threads: 0
Hi
I have exam after 12 hours, please help me to writing those programs……
And thank you
1)- Write a c++ program to output the histogram of a sequence of 10 positive integers. this program first asks the user to enter 10 integers. then write the histogram of this sequence on the screen . the histogram uses columns of *s to represent the integers. The height of a column equals the corresponding integer. Under the histogram,output the sequence.for instance, if the user enters a sequence 2 5 7 1 3 4 6 2 9 5 ,the output should look like the following :
*
*
* *
* * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * *
2 5 7 1 3 4 6 2 9 5
2)- Write a c++ program that evaluates a polynomial up to degree7. a polynomial is represented by an array of its coefficients.For instance, a polynomial
is represented by an array {2,-3,0,0,1,2,0,-7};a polynomial
the evaluation should be done by the following algorithm:
suppose x = a, and
calculated by the following steps:
the value v7 is P(a). you should use a loop to do this calculation.
I have exam after 12 hours, please help me to writing those programs……
And thank you
1)- Write a c++ program to output the histogram of a sequence of 10 positive integers. this program first asks the user to enter 10 integers. then write the histogram of this sequence on the screen . the histogram uses columns of *s to represent the integers. The height of a column equals the corresponding integer. Under the histogram,output the sequence.for instance, if the user enters a sequence 2 5 7 1 3 4 6 2 9 5 ,the output should look like the following :
*
*
* *
* * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * *
2 5 7 1 3 4 6 2 9 5
2)- Write a c++ program that evaluates a polynomial up to degree7. a polynomial is represented by an array of its coefficients.For instance, a polynomial
is represented by an array {2,-3,0,0,1,2,0,-7};a polynomial
the evaluation should be done by the following algorithm:
suppose x = a, and
calculated by the following steps:
the value v7 is P(a). you should use a loop to do this calculation.
•
•
Join Date: Jun 2008
Posts: 182
Reputation:
Solved Threads: 18
•
•
•
•
Hi
I have exam after 12 hours, please help me to writing those programs…
Good new it's you're still in time! Post what you've tried (first try something if you haven't yet), ask for help (the more specific you can), use code tags (I assume you didn't read this neither) when posting code and...
... help will fall from the sky, probably in time for your tomorrow exam if you do care enough to show us you take it seriously.
> u didnt know what i mean?
Oh we know exactly what you mean. It's standard homework which any of the competent helpers here would have no trouble doing in less time that it takes to reply to your thread.
But that won't teach you anything like as much as you trying it for yourself. You can read all the cookery books you like, but until you go into the kitchen and actually burn things, or make things boil over, you're not going to know that much. Repeated practical experience is what counts.
> i tried to fixing this problem and i wrote some codes but it didnt applied.
> so i need some help
So post what you tried then!
Oh we know exactly what you mean. It's standard homework which any of the competent helpers here would have no trouble doing in less time that it takes to reply to your thread.
But that won't teach you anything like as much as you trying it for yourself. You can read all the cookery books you like, but until you go into the kitchen and actually burn things, or make things boil over, you're not going to know that much. Repeated practical experience is what counts.
> i tried to fixing this problem and i wrote some codes but it didnt applied.
> so i need some help
So post what you tried then!
•
•
Join Date: Dec 2008
Posts: 3
Reputation:
Solved Threads: 0
#include <iostream.h>
int main()
{
int array[10];
int max=0,i
for(i=0;i<10;i++)
{
cout<<"Input the number"<<":";
cin>>array[i];
if(array[i]>max)
max=array[i];
}
cout<<" ";
for(i=max;i>=0;i--)
{
for(int j=0;j<10;j++)
if(array[j]>i)
cout<<"*";
else cout<<" ";
cout<<endl;
cout<<" ";
}for(i=;i<10;i++)
cout<<array[i]<<" ";
return (0);
}
int main()
{
int array[10];
int max=0,i
for(i=0;i<10;i++)
{
cout<<"Input the number"<<":";
cin>>array[i];
if(array[i]>max)
max=array[i];
}
cout<<" ";
for(i=max;i>=0;i--)
{
for(int j=0;j<10;j++)
if(array[j]>i)
cout<<"*";
else cout<<" ";
cout<<endl;
cout<<" ";
}for(i=;i<10;i++)
cout<<array[i]<<" ";
return (0);
}
![]() |
Other Threads in the C++ Forum
- Previous Thread: Array Question
- Next Thread: reading file
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library linkedlist linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






