Source code of 6.1.2 - Linear equation

 Idi na Hrvatsku Stranicu  Back  Programming  Next


 

10 CLS                 ' Clear the screen
11 CLEAR               ' Delete the contents of all variables
14 DEFDBL A-F, P-Z
20 REM Than this number further starts the program code
30 INPUT "Enter value for a" a
40 INPUT "Enter value for b" b
50 INPUT "Enter value for c" c
60 INPUT "Enter value for d" d
70 INPUT "Enter value for e" e
80 INPUT "Enter value for f" f
90 p = a - d: q = b - a
100 IF p = 0 AND q = 0 THEN PRINT "There is no solution!": GOTO 900
200 y = (c * d - a * f) / (a * e - b * d)
300 x = (c * e - b * f) / (a * e - b * d)
400 PRINT "x=" x, "y=" y
900 SLEEP
999 END                ' Completion of the programming code
1000 REM Than this number further start sub-programs

INPUT command could be instead of 6 lines 30 - 80 to enter only once. How?

Change DEFDBL A-F, P-Z in DEFSNG A-F, P-Z and in DEFINT A-F, P-Z. Analyze the way to represent the results for each of the changes.

Instead SLEEP useful to use a structure that asks whether you want to further use the program or not, which is associated with the push of a button. Which commands should be used for it?


 Back
 Search
 Next

Citing of this page:
Radic, Drago. " Informatics Alphabet " Split-Croatia.
{Date of access}; https://informatics.buzdo.com/file.
Copyright © by Drago Radic. All rights reserved. | Disclaimer
 Content - Home
 Content  Informatics Alphabet