Question: in vintage basic language I am receiving a error when compiling. It is a calculator application I which the user selects an operation to be
in vintage basic language I am receiving a error when compiling. It is a calculator application I which the user selects an operation to be performed. When selecting an operation, a recurring error of invalid is appearing.
Invalid choice. Please try again.
Additionally, I believe the computation functions such as addition, subtraction, multiplaticon need to be altered because when entered 2 3, it outputs 23 and not 5 for addition, not 6 for multiplication.
code through replit basic
10 PRINT "Calculator Application" 20 PRINT "---------------------" 30 PRINT "1. Addition" 40 PRINT "2. Subtraction" 50 PRINT "3. Division" 60 PRINT "4. Multiplication" 70 PRINT "5. Cosine" 80 PRINT "6. Tangent" 90 PRINT "7. Sine" 100 PRINT "Enter your choice (1-7):" 110 INPUT "type operation: "; I 120 FOR I = 1 TO 210 130 FOR I = 2 TO 270 140 FOR I = 3 TO 330 150 FOR I = 4 TO 390 160 FOR I = 5 TO 450 170 FOR I = 6 TO 490 180 FOR I = 7 TO 530 190 PRINT "Invalid choice. Please try again." 200 GOTO 100
REM addition: 210 PRINT "Enter first number:" 220 INPUT ""; a 230 PRINT "Enter second number:" 240 INPUT ""; b 245 c = a+b 250 PRINT c 260 end
REM subtraction: 270 PRINT "Enter first number:" 280 INPUT ""; a 290 PRINT "Enter second number:" 300 INPUT ""; b 305 c = a+b 310 PRINT c 320 end
REM division: 330 PRINT "Enter first number:" 340 INPUT ""; a 350 PRINT "Enter second number:" 360 INPUT ""; b 365 c = a/b 370 PRINT c 380 end
REM multiplication: 390 PRINT "Enter first number:" 400 INPUT ""; a 410 PRINT "Enter second number:" 420 INPUT ""; b 425 c = a*b 430 PRINT c 440 end
REM cosine: 450 PRINT "Enter the angle in degrees:" 460 INPUT ""; angle 470 PRINT COS(angle) 480 end
REM tangent: 490 PRINT "Enter the angle in degrees:" 500 INPUT ""; angle 510 PRINT TAN(angle) 520 end
REM sine: 530 PRINT "Enter the angle in degrees:" 540 INPUT ""; angle 550 PRINT SIN(angle) 560 end 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
