// comments noted, once the while function gets actived the program loops this only occurs when the shape does not fit with the values 1, 2 and 3 //I used for statement protect the input from deleting it self // I don't exactly know why the function work...help did extensive reading none of the lit has anything on the exactly how to push out a result // I activated the will statement and looped the program. it works brings me back to the start, but here is the real problem // once i try to work the code with a correct statement the program seems to crash or give a error in the code before the loop. // or a error in the code inside the loop. //please could you please highlight the best way forward? clc disp("which shape you want to calcalute the area or perimeter") disp("Square(1),Circle(2),Triangle(3)") for a=input("select your shape?") end pi4=(%pi/4); if a==1 then disp("square") for b=input("perimeter(1) or area(2)") end if b==1 then disp("perimeter") for x=input("size of side") end [d]=(x) d=x*4 horner(d,x) elseif b==2 disp("area") for c=input("size of side") end function e(c)=c^2 endfunction horner(e) end elseif a==2 then disp("circle") for f=input("perimeter(1) or area(2)") end if f==1 then disp("perimeter") for g=input("size of diameter") end function h(g)=g*pi4*4 endfunction elseif f==2 disp("area") for j=input("size of diameter") end function k(j)=pi4*j^2 endfunction end elseif a==3 then disp("triangle") for l=input("perimeter(1) or area(2)") end if l==1 then disp("perimeter") for m=input("size of base") end for n=input("size of height") end function o(m,n)=m+n((m^2)+(n^2))^0.5 endfunction elseif l==2 then disp("area") for p=input("size of base") end for q=input("size of height") end function r(p,q)=0.5*p*q endfunction end end while a<1 |a>3//loop happens when a does not get 1 or 2 or 3 //loop i tried did not work so well "while a<>1 or a<>2 or a<>3" disp("which shape you want to calcalute the area or perimeter") disp("Square(1),Circle(2),Triangle(3)") for a=input("select your shape?"); end pi4=(%pi/4); if a==1 then disp("square") for b=input("perimeter(1) or area(2)") end if b==1 then disp("perimeter") for c=input("size of side") end function d(c)=c*4 endfunction elseif b==2 disp("area") for c=input("size of side") end function e(c)=c**2 endfunction end elseif a==2 then disp("circle") for f=input("perimeter(1) or area(2)") end if f==1 then disp("perimeter") for g=input("size of diameter") end function h(g)=g*pi4*4 endfunction elseif f==2 disp("area") for j=input("size of diameter") end function k(j)=pi4*j^2 endfunction end elseif a==3 then disp("triangle") for l=input("perimeter(1) or area(2)") end if l==1 then disp("perimeter") for m=input("size of base") end for n=input("size of height") end function o(m,n)=m+n((m^2)+(n^2))^0.5 endfunction elseif l==2 then disp("area") for p=input("size of base") end for q=input("size of height") end function r(p,q)=0.5*p*q endfunction end//here is a error no idea why?? end end// and here error