``` 10 REM Sample problem 20 DATA 20.95,29.50,22.50,13.95,19.50,0 30 N = 0 40 SUM = 0 50 MAX = 0 60 READ PRICE 70 IF PRICE = 0 THEN 130 80 N = N + 1 90 SUM = SUM + PRICE 100 IF MAX > PRICE THEN 60 110 MAX = PRICE 120 GOTO 60 130 PRINT N, SUM, MAX 140 END ``` BASIC ``` REM Sample problem DATA 20.95,29.50,22.50,13.95,19.50,0 N = 0 Sum = 0 MaxPrice = 0 READ Price WHILE Price > 0 N = N + 1 Sum = Sum + Price IF Price > MaxPrice THEN MaxPrice = Price END IF READ Price WEND PRINT N, Sum, MaxPrice STOP END ``` Quick BASIC ``` C Sample Program INTEGER N REAL MAX, PRICE, SUM 100 FORMAT(F10.2) 101 FORMAT(5X,I5,2F8.2) N = 0 SUM = 0.0 MAX = 0.0 1 READ(5,100) PRICE IF(PRICE .EQ. 0.0) GO TO 2 N = N + 1 SUM = SUM + PRICE IF(PRICE .GT. MAX) MAX = PRICE GO TO 1 2 WRITE(6,101) N, SUM, MAX STOP END ``` Fortran IV ``` BEGIN COMMENT SAMPLE PROBLEM; INTEGER N; REAL MAX, PRICE, SUM; N := 0; SUM := 0; MAX := 0; READ(PRICE); WHILE PRICE > 0 DO BEGIN N := N + 1; SUM := SUM + PRICE; IF PRICE > MAX THEN MAX := PRICE; READON(PRICE); END; WRITE(N,SUM,MAX) END. ``` Algol W ``` program SampleProblem; var N : integer; MaxPrice,Price,Sum : Real; begin N := 0; Sum := 0; MaxPrice := 0; write('Enter price: '); readln(Price); while Price > 0 do begin N := N + 1; Sum := Sum + Price; if Price > MaxPrice then MaxPrice := Price; write('Enter price: '); readln(Price) end; writeln(N:5,Sum:10:2,MaxPrice:10:2) end. ``` Pascal