hey i need help in creating a program, this is the question :
Write a C++ program that uses a loop to read integers between 1 and 5 (inclusive) from the user. Once the loop terminates, the program prints a histogram of the entered values. Here is an example output:
1 *******
2 *
3 **********
4 ***
5 **
This means that the value 1 was entered 7 times and so forth.
and it should be done using counter controlled while loops
thanks in advance
1
Expert's answer
2011-10-25T08:28:57-0400
// Histogram of the entered values.cpp : Defines the entry point for the console application. //
using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int value; int countfor1=0; int countfor2=0; int countfor3=0; int countfor4=0; int countfor5=0; int arrayvalue[1000]; cout<<"Enter value:"; for(;;){ cin>>value; if(value>=1 && value<=5){ if(value==1){ countfor1++;
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment