Guest_imported
New member
- Jan 1, 1970
- 0
i would like to output "p" and "p1" in a descending order
"p" or "p1"is not in an array or is being taken from one. it is from a formula.
I would greatly appreciate the help
CLS
'Read data and calculate best total'
INPUT "Please enter an INPUT VOLTAGE ", vin
INPUT "Please enter an OUTPUT VOLTAGE ", vout
INPUT "Please enter an INPUT IMPEDANCE ", z
DIM percoferror AS DOUBLE
DIM current AS DOUBLE
DIM vr1 AS DOUBLE
DIM vres2 AS DOUBLE
DIM diffvoltage AS DOUBLE
DIM seed#(256)
DIM res#(256)
REM
I = 1
READ seed#(I)
WHILE seed#(I) <> 0
I = I + 1
READ seed#(I)
WEND
datastrlength = I - 1
arraylength = 0
FOR J = 0 TO 6
FOR I = 1 TO datastrlength
FOR h = 1 TO datastrlength + 1
arraylength = arraylength + 1
res = (10 ^ J) * seed#(I)
res2 = (10 ^ 4) * seed#(h)
zt = res + res2
current = vin / zt
vr1 = current * res
vres2 = vin - vr1
diffvoltage = vout - vres2
p = (diffvoltage / vout) * 100
IF zt >= z THEN
IF p >= 0 THEN
IF p <= 7 THEN
FOR t = 1 TO 100000
NEXT t
PRINT p
END IF
END IF
END IF
NEXT h
NEXT I
NEXT J
datastrlength = I - 1
arraylength = 0
FOR J = 0 TO 6
FOR I = 1 TO datastrlength
FOR h = 1 TO datastrlength + 1
arraylength = arraylength + 1
res = (10 ^ J) * seed#(I)
res2 = (10 ^ 5) * seed#(h)
zt = res + res2
current = vin / zt
vr1 = current * res
vres2 = vin - vr1
diffvoltage = vout - vres2
p1 = (diffvoltage / vout) * 100
IF zt >= z THEN
IF p1 >= 0 THEN
IF p1 <= 7 THEN
FOR t = 1 TO 100000
NEXT t
PRINT p1
END IF
END IF
END IF
NEXT h
NEXT I
NEXT J
DATA 1.0,1.2,1.5,1.8,2.2,2.7,3.3,3.9,4.3,4.7
DATA 5.1,5.6,6.2,6.8,7.5,8.2,9.1,0
END
"p" or "p1"is not in an array or is being taken from one. it is from a formula.
I would greatly appreciate the help
CLS
'Read data and calculate best total'
INPUT "Please enter an INPUT VOLTAGE ", vin
INPUT "Please enter an OUTPUT VOLTAGE ", vout
INPUT "Please enter an INPUT IMPEDANCE ", z
DIM percoferror AS DOUBLE
DIM current AS DOUBLE
DIM vr1 AS DOUBLE
DIM vres2 AS DOUBLE
DIM diffvoltage AS DOUBLE
DIM seed#(256)
DIM res#(256)
REM
I = 1
READ seed#(I)
WHILE seed#(I) <> 0
I = I + 1
READ seed#(I)
WEND
datastrlength = I - 1
arraylength = 0
FOR J = 0 TO 6
FOR I = 1 TO datastrlength
FOR h = 1 TO datastrlength + 1
arraylength = arraylength + 1
res = (10 ^ J) * seed#(I)
res2 = (10 ^ 4) * seed#(h)
zt = res + res2
current = vin / zt
vr1 = current * res
vres2 = vin - vr1
diffvoltage = vout - vres2
p = (diffvoltage / vout) * 100
IF zt >= z THEN
IF p >= 0 THEN
IF p <= 7 THEN
FOR t = 1 TO 100000
NEXT t
PRINT p
END IF
END IF
END IF
NEXT h
NEXT I
NEXT J
datastrlength = I - 1
arraylength = 0
FOR J = 0 TO 6
FOR I = 1 TO datastrlength
FOR h = 1 TO datastrlength + 1
arraylength = arraylength + 1
res = (10 ^ J) * seed#(I)
res2 = (10 ^ 5) * seed#(h)
zt = res + res2
current = vin / zt
vr1 = current * res
vres2 = vin - vr1
diffvoltage = vout - vres2
p1 = (diffvoltage / vout) * 100
IF zt >= z THEN
IF p1 >= 0 THEN
IF p1 <= 7 THEN
FOR t = 1 TO 100000
NEXT t
PRINT p1
END IF
END IF
END IF
NEXT h
NEXT I
NEXT J
DATA 1.0,1.2,1.5,1.8,2.2,2.7,3.3,3.9,4.3,4.7
DATA 5.1,5.6,6.2,6.8,7.5,8.2,9.1,0
END