Solved

Graduation a columm?

Posted on 1997-11-16
2
298 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
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE, DataSnap, JSon and java 8 1,038
Tstream to hex 1 1,701
Extract text from webbrowser 5 1,394
websites monitor c++ or delphi 9 448
One of the biggest threats in the cyber realm pertains to advanced persistent threats (APTs). This paper is a compare and contrast of Russian and Chinese APT's.
An article on effective troubleshooting
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 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