Solved

Posted on 1997-11-16
305 Views
Student in panic!
I need a program which simulates licquid in a tank. The user is supposed to write down a value and after that it´s supposed to be written a vertical line whith (I) and the column will be graduated 10, 20, 30 and 40. All this will be centered on the screen. I need two FOR loops, one for the column and one for the graduation.
Sincerely,
Erika
0
Question by:gelotte
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 2

Accepted Solution

mitchell042997 earned 50 total points
ID: 1216791
If I am not mistaken, first the user needs to enter the water depth, so something like this will do the trick:

uses crt;
var WaterDepth,loop1,loop2:byte;
begin
repeat
writeln('Enter Water Depth (10, 20, 30, 40):  ');
{Check to make sure WaterDepth within valid range}
until WaterDepth in [10,20,30,40];

clrscr;

for loop1:=1 to 9 do
if (loop1 mod 2 = 0) then begin
gotoxy(36,loop1+7);
case loop1 of
2:write('40 | |');
4:write('30 | |');
6:write('20 | |');
8:write('10 | |');
end;
end else begin
gotoxy(39,loop1+7);
write('| |');
end;

gotoxy(39,8+loop1);
write('___');

{For the water, just make another case statement and in the case blocks (i.e. case WaterDepth of ... 10:begin for ... do) do a for loop to draw the water depth using gotoxy like I showed above.  Hope this all helps.  BTW, no guarentee on the code, never tested it out...}
0

Author Comment

ID: 1216792
thanks mitchell it´s works
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
The conference as a whole was very interesting, although if one has to make a choice between this one and some others, you may want to check out the others.  This conference is aimed mainly at government agencies.  So it addresses the various compli…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
###### Suggested Courses
Course of the Month8 days, 18 hours left to enroll