# Easy C++ draw a histogram-type graph Project

Write a **main** function to input a sequence of numbers and draw a histogram-type graph of them:

1. Loop to read integers, one per line, from **cin**, until you hit the end of the data (for this lab, that means until the integer you read is negative). As you read each integer:

1. Check the value of the integer ?&#8364;" if the value is less than zero, exit the loop normally. If it is greater than 100, write an informative error message to **cerr** and exit the program.

2. Calculate how many asterisks you'll need to use to graph the integer, figuring that zero asterisks represents a value of 0, one asterisk represents a value of *either* 1 or 2, two asterisks *either* 3 or 4, ..., and 50 asterisks *either* 99 or 100. (Be sure to test your program and check the output, making sure the program is putting out the right numbers of asterisks <nobr>--</nobr> this is a great example of a "hidden" bug, one that you have to test for in order to find.)

3. Write a line to **cout** containing the integer value, a flag character, and the correct number of asterisks to represent the integer you just read:

* Use a field width of 5 for writing the (right-justified) integer.

* Put exactly one space before and after the flag character, which should be the digit '2' if the number is a perfect square, or a capital 'X' if it is not. (*Hint:* to check for "perfect square", see if the square root of the number is a whole number.)

* Left-justify the span of asterisks after that.

(Note: because you checked that the input number is between 0 and 100, you can't possibly put out more than 50 asterisks, so you don't have to check at this point whether the output line is too long for the page.)

2. When you read the terminating negative value from **cin**, write a text line to **cout** that says you're done.

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.

3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).

## Platform

Must be fuctional in microsoft visual c++ 6.0

Acerca do Empregador:
( 9 comentários ) United States

ID do Projeto: #3016414

## Concedido a:

brainstormingvw

See private message.

\$7 USD em 1 dia
(5 Comentários)
0.6

## 14 freelancers estão ofertando em média \$11 para esse trabalho

mihaiscortaru

See private message.

\$16.15 USD em 1 dia
(157 Comentários)
6.0
SKDevelopment

See private message.

\$10.2 USD em 1 dia
(23 Comentários)
5.9
devicode

See private message.

\$15.3 USD em 1 dia
(69 Comentários)
4.7
alexpyrkov

See private message.

\$8.5 USD em 1 dia
(16 Comentários)
4.5
assertvw

See private message.

\$7.65 USD em 1 dia
(12 Comentários)
4.4
shashikhanvw

See private message.

\$13.6 USD em 1 dia
(15 Comentários)
3.8
andrewlazarev

See private message.

\$7.65 USD em 1 dia
(12 Comentários)
3.6
hotsunvw

See private message.

\$10.2 USD em 1 dia
(7 Comentários)
3.2
zolikavw

See private message.

\$7.65 USD em 1 dia
(14 Comentários)
2.4
ignatvw

See private message.

\$17 USD em 1 dia
(3 Comentários)
1.5
thanasisk

See private message.

\$8.5 USD em 1 dia
(5 Comentários)
0.9
draqon

See private message.

\$17 USD em 1 dia
(0 Comentários)
0.0
shaileshbansal

See private message.

\$11.05 USD em 1 dia
(0 Comentários)
0.0