Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help with this program its c programming Histogram ASSIGNMENT Write a program to display a histogram based on a number entered by the

i need help with this program its c programming

image text in transcribed

Histogram ASSIGNMENT Write a program to display a histogram based on a number entered by the user. A histogram is a graphical representation of a number (in our case, using the asterisk character). On the same line after displaying the histogram, display the number. The entire program will repeat until the user enters zero or a negative number. Before the program ends, display Bye The program will ask he user to enter a non zero posit ve number Using a while oop validate that the number s not greater than 40 and f so re as or the number Pl the entire o ram to a sentine controlled loop so that the user can enter either zero (0) or a negative number to end the program Create constants for 1 (the minimum number for the histogram). and 40 (the maximum number for the histogram), and use these constants in the prompts, the validation condition and error message, and the sentinel-controlled loop and the histogram loop. Hints: Validation messages are indented 3 spaces You can use either a pre-test loop (with the initial prompt outside the loop, and the re-prompt at the end of the loop) or a post-test loop (with the prompt inside the loop, and a decision to print the histogram also inside to loop) Coded the histogram using a for loop (although any type of loop could be used) Example Run: bold type is what is entered by the user) Enter a non-zero positive number less than 40: 5 5 Enter another non-zerpositive number less than 40: 48 The number entered was greater than 40. Please re-enter: 8 Enter an ther non-zero p sitive number less than 40: Bye... The example run shows EXACILY how your program input and output will look. -1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions