I had my Java term paper yesterday, it was terrible. After the exam, i've attempted the question again but i still can't get the correct output. So i would appreciate if you guys can help me out here...

The question:

Create a class, TextGraph, which will draw a diagonal graph using text graphics. Here is an example of what the output of this program would look like if we told it the size was 80x24:

Code:

000
0000
000
000
0000
000
0000
000
0000
0000
0000
0000

The formula of the graph is, x(height/width)=y

Since the origin starts at the bottom left hand corner, at that position, the first four "0"s are calculated by subsituting x=0,1,2 or 3 into the equation which will give the value y=0 when you convert it to integer

The last three "0"s (upper right hand) is computed based on the value of x=77,78 or 79. All produce y=23