Skip to content
← Back to Community
HOW TO MAKE AN CALCULATOR IN QBASIC
Profile icon
warriorxyz

HI I AM WARRIOR (I AM 13) AND I AM GOING TO HELP YOU ON MAKING A BASIC CALCCULATOR WITH QBASIC

1:INPUT OUTPUT

SO LETS MAKE SOME CODE FOR GETING INFO FROM THE USER AND GIVING OUTPUT. I AM USING THE PRINT STATEMENT TO GIVE OUTPUT AND INPUT STATEMENT FOR INPUT LOL

CODE:
PRINT "BOOTING SOFTWARE......."
PRINT
PRINT "SOFTWARE SUCSUFULY BOOTED"
PRINT
PRINT "HELLO USER"
PRINT "MAY I KNOW YOUR NAME?"
INPUT USER$

2:JUST TALKING

ONCE YOU GET THE INPUT FROM THE USER THEN YOU JUST TALK TO THE USER.

CODE:
PRINT "HELLO "; USER$
PRINT
PRINT "SO "; USER$ ; " HOW MAY I HELP YOU IN MATHS?"
PRINT "PRESS 1 FOR ADDITION, 2 FOR SUBTRACTION, 3 FOR DIVISION AND 4 FOR MULTIPLICATION"
INPUT CHOICE$

3:IF ELSE IF

NOW WE JUST NEED TO ADD THE IF ELSE CODE TO AND THEN TEST IT. IF IT COMES WRONG TRY AGAIN AND FIX

CODE:IF CHOICE$ = "1" THEN
PRINT "OHH SO YOU WANT TO ADD OKAY LEMME HELP YOU OUT"
PRINT "TYPE YOUR FIRST NUMER YOU WAN TO ADD WITH"
INPUT A
PRINT "OKAY NOW TYPE THE OTHER NUMBER"
PRINT USER$; " YOUR ANSWER IS ..."
INPUT B
PRINT A + B

ELSE IF CHOICE$ = "2" THEN
PRINT "OHH SO YOU WANT TO SUBTRACT OKAY LEMME HELP YOU OUT"
PRINT "TYPE YOUR FIRST NUMER YOU WAN TO SUBTRACT WITH"
INPUT C
PRINT " OKAY NOW TYPE THE OTHER NUMBER"
INPUT D
PRINT USER$; " YOUR ANSWER IS ..."
PRINT C - D
ELSE IF CHOICE$ = "3" THEN
PRINT "OHH SO YOU WANT TO DIVIDE OKAY LEMME HELP YOU OUT"
PRINT "TYPE YOUR FIRST NUMER YOU WAN TO DIVIDE WITH"
INPUT E
PRINT " OKAY NOW TYPE THE OTHER NUMBER"
INPUT F
PRINT USER$; " YOUR ANSWER IS ..."
PRINT E / F
ELSE IF CHOICE$ = "4" THEN
PRINT "OHH SO YOU WANT TO MULTIPLIE OKAY LEMME HELP YOU OUT"
PRINT "TYPE YOUR FIRST NUMER YOU WAN TO MULTIPLIE WITH"
INPUT G
PRINT " OKAY NOW TYPE THE OTHER NUMBER"
INPUT H
PRINT USER$; " YOUR ANSWER IS ..."
PRINT G * H
ELSE
PRINT "INPUT WRONG RE RUN SOFTWARE"
END IF

4: END

NOW JUST RUN YOUR PROJECT IN IT SHOULD WORK IF NOT WRITE ORE CODE TO FIX IT LOL

Voters
Profile icon
GoodBoy27
Profile icon
warriorxyz
Comments
hotnewtop
Profile icon
warriorxyz

and sub to my channel name will be leaked soon lol

Profile icon
warriorxyz

hope this was helpfull