Home > Back-end >  Ask god to help C=A, B, A and B is A variable mathematical formula how to make A small program
Ask god to help C=A, B, A and B is A variable mathematical formula how to make A small program

Time:09-15

For example, I want to do A small computing software: {)/12 (A * B * 17.5}/3.5 * 1.2=C, A, B as A variable, such A formula I think separately generated A small software, as long as the inside the box to fill in A, B value can get the result of C, how to do?

CodePudding user response:

Too simple,
Add a form, and then two text edit box, limited number, and then use a button or write in the change event of calculated results with the edit text box labe component or edit component showed the result?

CodePudding user response:

So simple?
Use two TEdit as input and output using a text to display, then into your formula,
Two TEdit the input value is A and B,,,
TEdit using OnChange event line

CodePudding user response:

The
reference 2 floor, Frank. WU response:
so simple?
Use two TEdit as input and output using a text to display, then into your formula,
Two TEdit the input value is A and B,,,
TEdit just using OnChange event

Hello, would you answer the above questions should use what software

CodePudding user response:

Such a simple functional language with can be anything, such as writing a command-line program in Delphi:
 
{$APPTYPE CONSOLE}
The program CAL.
Var
A, b: double;
Code: integer;

{the main}
The begin
If ParamCount & lt; 2 then
The begin
Writeln (' usage: CAL number1 number2 ');
exit;
The end;

Val (ParamStr (1), a, code);
If code & lt;> 0 then
The begin
Writeln (' invalid parameter: 'ParamStr (1));
exit;
The end;

Val (ParamStr (2), b, code);
If code & lt;> 0 then
The begin
Writeln (' invalid parameter: 'ParamStr (2));
exit;
The end;

Writeln (((A * B)/12 * 17.5)/3.5 * 1.2: shall);
End.

CodePudding user response:

A word, because of the complexity of the calculation formula and uncertainty, can consider two kinds of schemes, namely the SQL commands and scripts, let it to calculate the value!

CodePudding user response:

His request is only two variables fixed formula, if it is not a fixed formula, need to write an expression evaluation function, the expression of the first variable a, b... Replace the actual input value, and then 3 evaluates the expression, use SQL should also can, but I didn't try

CodePudding user response:

refer to 6th floor early play big play nuclear response:
his request only two variables fixed formula, if it is not a fixed formula, the need to write an expression evaluation function, the expression of the first variable a, b... Replace the actual input value, and then 3 evaluates the expression, use SQL should also can, but I didn't try

https://blog.csdn.net/fyl_077/article/details/49929335

CodePudding user response:

refer to 7th floor liups response:
Quote: refer to the sixth floor early play big play nuclear war reply:
his request only two variables fixed formula, if it is not a fixed formula, the need to write an expression evaluation function, the expression of the first variable a, b... Replace the actual input value, and then 3 evaluates the expression, use SQL should also can, but I didn't try

https://blog.csdn.net/fyl_077/article/details/49929335


Learning, VBS can also be used, so the performance requirements of occasions can simplify a lot of code

CodePudding user response:

reference 5 floor liups reply:
say two sentences, because of the complexity of the calculation formula and uncertainty, consider two kinds of schemes, namely the way SQL commands and scripts, let it to calculate the value!

Dig out before writing the test program, here:


Standing outside the connection, don't know whether to download, I'll give it a try
http://bbs.2ccc.com/attachments/2020/lps_2020827192743.zip