Forums Register Login

trying to print histogram i scatched my last one and started over still stuck

+Pie Number of slices to send: Send

getting compile error
for (int j = 0; j <count; j++ )
cannot find symbol variable count
also truing to get this to ask user for int and print out
Enter a value to plot: 4

Enter a value to plot: 5

Enter a value to plot: 5

Enter a value to plot: 4

Enter a value to plot: 5

Enter a value to plot: 9

Enter a value to plot: 0

1 |

2 |

3 |

4 | ##

5 | ###

6 |

7 |

8 |

9 | #

10 |
any help will be greatly appreciated it has been along time for me i used to do java a long time ago and now starting to go back to school i feel like i am brand new again
+Pie Number of slices to send: Send
 

cannot find symbol variable count  


Where is the variable: count defined?  The compiler can not find its definitiion.

Note:  The variables named: count1 through count10 should be defined as an array, not as individual variables.
+Pie Number of slices to send: Send
is there an example i can see what you are talking about
1
+Pie Number of slices to send: Send
 

an example i can see what you are talking about


Your other thread used an array: nums to count entered  values.  See line 13

https://coderanch.com/t/668096/java/java/stuck-create-historgram

Use the code in the first part of that thread to collect the numbers.
Rewrite the second part of the code to print one line for each element in the array.
For the first attempt, print the number, the | and the count.

When that works, work on the code to replace the count with a row of #s
Climb the rope! CLIMB THE ROPE! You too tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 382 times.
Similar Threads
Assignment does not make sense to me.
Declaring Multiple Private Variables
Java Collections- Retrival from nested while loops
Finished my so-called program with many errors
Exception in Thread-Inventory Program
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:16:33.