Solved

Graduation a columm?

Posted on 1997-11-16
2
307 Views
Last Modified: 2010-04-16
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
Comment
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
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
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):  ');
    readln(WaterDepth);
    {Check to make sure WaterDepth within valid range}
  until WaterDepth in [10,20,30,40];

  clrscr;

  {Loop to draw flask}
  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

by:gelotte
ID: 1216792
thanks mitchell it´s works
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Part One of the two-part Q&A series with MalwareTech.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question