[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/17/2001 at 11:50PM PST, ID: 20235246
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

validation, withdraw & replenish function?

Asked by slchua in Pascal Programming Language

I am writing a stock program and would like to check an assigned ?stock.dat? file as to make sure that the new stock number entered does not exist in the file. This is to avoid any duplication/redundancy. I need your assistance to guide me. For those who are expert in Pascal 7, please don?t hesitate to correct it as I am still a beginner.


{------------------------------------------------------}
BEGIN
  Assign(StockFile,'D:\Stock.dat');
  Stock_Prg; {stock program module}
END.
{------------------------------------------------------}

Secondly, my stock program consist stock movement feature which can withdraw and replenish stock item.
I need to validate the option entered. If I chooses the withdrawal option, the program should:

1. prompt the user to input the stock number to withdraw the quantity form.

2. find the stock number entered in the file.

3. if the stock number not found, display an error message and prompt the user if he/she wants to continue again.

4. the quantity to withdraw is not more than quantity on  hand and is not a negative value. Display an error message if so to inform the user.

5. otherwise subtract the withdrawal value from the quantity on hand and give new value to quantity on hand in the file.(update the quantity on hand)

6. prompt the user if he/she wants to continue withdraw other stock item.

If I chooses the replenish option, the program should:

1. prompt the user to input the stock number to replenish the quantity form.

2. find the stock number entered in the file.

3. if the stock number not found, display an error message and prompt the user if he/she wants to continue again.

4. if the stock number found, display the data about the stock no. Next prompt the user to enter the quantity to replenish.

5. the quantity to replenish is a logical value. Display an error message if it is not logical value to inform the user.

6. otherwise add the replenish value to the quantity on hand and give new value to quantity on hand in the file.(update the quantity on hand)

7. prompt the user if he/she wants to continue replenish other stock item.

Besides that, do I need to enter ?Val? procedure to perform the stock movement option? I just showed the important part and didn?t show the all of them such as the program menu code, display control code and etc. Thank you in advance.


{---------------------------------------------------}
TYPE
  StockRecord = RECORD
     StockNo   : STRING[5];
     StockDesc : STRING[35];
     Price     : REAL;
     QtyOnHand : STRING[3];
     Withdraw  : STRING[3];
     Replenish : STRING[3];
  END;

VAR
EnterStkNo, EnterDesc, EnterPrice, EnterQty : Boolean;
No, StkNum, QtyNum: Word;
StrPrice: String;

Val(StockNo, StkNum, No);
Val(QtyOnHand, QtyNum, No);
Val(StrPrice, Price, No);
{--------------------------------------------------}

[+][-]11/24/01 09:08 PM, ID: 6650816

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/25/01 05:36 AM, ID: 6650986

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/27/01 06:58 AM, ID: 6655360

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/27/01 05:57 PM, ID: 6656980

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Pascal Programming Language
Sign Up Now!
Solution Provided By: scrapdog
Participating Experts: 3
Solution Grade: A
 
 
[+][-]12/03/01 11:57 AM, ID: 6664644

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/08/03 08:20 PM, ID: 9314527

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/03 09:15 AM, ID: 9371493

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74