I have made a program that tells whether you are a minor or adult
Here is the link
Language: Made with QBasic
Looks cool!
Is QBasic different from Basic? If so, I’ve never heard of it. However, at least in the U.S., it’s easy to tell: <18 is minor and >=18 is adult.
Well you mean 0<18 …
PRINT "This program find whether you are MINOR or ADULT"
CLS
M$ = "Minor" : A$ = "Adult"
PRINT "Enter your age"
INPUT age
IF age < 18 THEN
PRINT M$
ELSE
PRINT A$
END IF
END
Why do you print a title just to clear it?
To be honest he/she/they/… is/are posting lot of basic stuff almost as if to racket stats for the leader-board … another obsessed competitive like @CoderElijah …??
I think so. They didn’t really follow the guidelines of #general:showcase XD. And not to be rude, but this IS just a basic QBasic program (I don’t know any Basic or QBasic so I might be wrong here).
There was basic, then they made quick basic to simplify things, then they made Qbasic to make a simplified simplified basic …
This is why Python is better: one line.
print("Minor" if int(input("This program find whether you are MINOR or ADULT\nEnter your age\n")) < 18 else "Adult")
Remember age 0 or negative … not a minor but a ghost.
Was basic supposed to be simple to start?
Can you use elif in this as well? (I was always curious how these were done)
No. You could put if/else statements inside the else statement though IIRC. I know you can for lambda
. It’s really cool to see an entire program in one line with lambda
. @Totovim can do that.
basic was simple, but i guess for some not so simple
It turns the string into a number and no is more than 18
Apparently inputting any string will say you’re an adult
How to break it:
Type your age with letters ie. Thirteen
Then it breaks it lol. You are saying you are thirteen yet it calls you an adult because of the weird string thing.
all ascii numbers in most low-level programming languages are converted to integers see ascii chart