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.

Recommended Answers

All 6 Replies

Hi
I have exam after 12 hours, please help me to writing those programs…

Well, you better hurry then. Although you could have invested 5 minutes of your time in reading this (even if I think that just the title is pretty explicative). By doing that you could have obtained a much more helpful reply than this.

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?
i tried to fixing this problem and i wrote some codes but it didnt applied.
so i need some help
and thank u for advice

How may we help if we don't see what problems did you encountered? Post the code you wrote and explain what trouble did it caused.

Don't expect anyone to write the full program and post-fed it to you.

> 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!

commented: great reply, as usual :-) +2
#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);
}

I suggest you go read post #2 again, and figure out how to use code tags.
It's not rocket science, though you have to wonder from the number of times it's mentioned before you post, while you post, and now this post reminding you about it all.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.