Learning BASIC | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Learning BASIC

can anyone tell me whatā€™s wrong with this i canā€™t figure out how to fix syntax error in line 25. iā€™m pretty new to this and would like to learn this as an opening for future jobs. 10 PRINT "Hello" 15 LET A = 9 20 LET B = 10 21 25 IF 19=A+B LET A+B=19 30 PRINT "What's the answer to 9+10" 40 IF INPUT "19" THEN PRINT "Good Job" 50 END 51 60

2nd May 2020, 2:08 PM
DonutDude
DonutDude - avatar
7 Respostas
+ 8
DonutDude One challenge you might encounter is finding people familiar enough with BASIC to provide much help. I haven't messed around with BASIC myself since the 1990s. Regardless, good luck with learning. Also, I think the following will get past your syntax errors. -------- LET A = 9 LET B = 10 IF 19=A+B THEN LET C=19 INPUT "What's the answer to 9+10"; D IF C = D THEN PRINT "Good Job" END
2nd May 2020, 3:05 PM
David Carroll
David Carroll - avatar
+ 4
The biggest problem is you are trying to learn BASIC. However, the syntax errors that jump out to me are: LINE 25: - Missing `Then` and you can't assign a value `19` to an expression `A+B`. LINE 40: - I don't believe you can use the INPUT() function as a conditional expression for the IF statement.
2nd May 2020, 2:40 PM
David Carroll
David Carroll - avatar
+ 4
DonutDude at least you didn't use a GOTO statement! Otherwise you might of been banned from Sololearn šŸ˜‚šŸ˜‚šŸ˜‚
2nd May 2020, 8:37 PM
Paul K Sadler
Paul K Sadler - avatar
+ 3
Also the implementations of BASIC varied in their syntax. For example Pick Basic, IRIS Business Basic, Apple Basic and the list goes on.
2nd May 2020, 5:23 PM
Paul K Sadler
Paul K Sadler - avatar
+ 2
I think you cant make A+B=19, since this could also set A to 8 and B to 11. But I dont know Basic maybe I am wrong
2nd May 2020, 2:15 PM
Alexander Thiem
Alexander Thiem - avatar
+ 1
im just using this as a starting ground like python. i only want to understand this stuff but thank you
2nd May 2020, 2:45 PM
DonutDude
DonutDude - avatar
0
Future Jobs. That's funny. You are preparing for future jobs by learning an obviously outdated language created in 1963.
2nd May 2020, 2:23 PM
Ore
Ore - avatar