answersLogoWhite

0


Best Answer

I was able to create a login program in qbasic with this simple code:

cls

1 input "Username: " , username$

if username$ <> "Define what you want your name to be here (use the quotes)" then goto 1

else input "Password: " , password$

if password$ <> "Again define using quotes" then goto 1 else print "You have successfully logged in!"

Hope this helps!

===

I would have rewritten the above code...-without using outdated line numbers/being combined together with goto statements-...as being the following...

'*** set username/password...

userName$="abc"

passWord$="123"

'*** get username/password

DO

CLS

PRINT "Log in..."

PRINT

INPUT "Username: ", guessUserName$

INPUT "Password: ", guessPassWord$

LOOP UNTIL guessUserName$=userName$ AND guessPassWord$=passWord$

'*** print welcome screen...

CLS

PRINT TIME$ + " " + DATE$

PRINT

PRINT "Congratulations, "; userName$; ", you have successfully logged in!"

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

I know that one... I've done it a million times for either practice or my practical tests. I'm a ninth grader. What grade are you?

Anyway, here's how to make a simple calculator. When you make one, be sure to follow this script and put in the cases as done here. I'm showing you how to make one with just two numbers, but you can adjust it later to fit in three, four, or as many numbers as you want.

10 CLS

20 PRINT "Welcome to the QBasic Calculator!"

30 PRINT "Enter two numbers."

40 INPUT nm, nm1

50 PRINT "Choose a basic operation:"

60 PRINT "1. Add 2. Subtract 3. Multiply 4. Divide"

70 INPUT num

80 IF num = 1 THEN 100

90 IF num = 2 THEN 110

91 IF num = 3 THEN 120

92 IF num = 4 THEN 130

100 PRINT "The result is"; nm + nm1

GOTO 140

110 PRINT "The result is"; nm - nm1

GOTO 140

120 PRINT "The result is"; nm * nm1

GOTO 140

130 PRINT "The result is"; nm / nm1

140 PRINT "Hope you enjoyed the math!"

END

That's how you make a simple calculator. (QBasic always makes things simple once you get what it's trying to tell you.) If you want to know how you can do more calculations without exiting the program/output screen, just post another question----and leave the teaching to me!

Ciao for now!

======

I would have rewritten the above code...-without using outdated line numbers/together with goto statements-...as being the following, instead...

CLS

PRINT "Welcome to the QBASIC Calculator!"

PRINT "Enter two numbers each separated by a comma: (n,n)"

INPUT num1, num2

PRINT "Choose a basic operation:"

PRINT "MENU: 1> Add 2> Subtract 3> Multiply 4> Divide"

INPUT "Type a menu selection number from 1 to 4"; opNo%

SELECT CASE opNo%

CASE 1: answer = num1 + num2

CASE 2: answer = num1 - num2

CASE 3: answer = num1 * num2

CASE 4: answer = num1 / num2

END SELECT

PRINT "The answer is: "; answer

PRINT "Hope you enjoyed the math!"

END

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

You can make a program in qbasic very simply. Just you have to learn the commands, their syntax and where to use them. That's all and you can make any qbasic program that you want. For example

a program to print the table of any number:

CLS

INPUT "ENTER ANY NUMBER FOR TABLE" ;TABLE

CLS

FOR ANSWER=TABLE TO (TABLE*10) STEP TABLE

PRINT ANSWER

NEXT

END

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

CLS

PRINT "PROGRAM: Simple Calculator"

PRINT

INPUT "First number: ", num1%

INPUT "Second number: ", num2%

PRINT

PRINT "Type: 'A', to Add"

PRINT "Type: 'S', to Subtract"

PRINT "Type: 'D', to Divide"

PRINT "Type: 'M', to Multiply"

PRINT

INPUT "Please, enter your letter: ", letter$

PRINT

SELECT CASE letter$

CASE "A": PRINT num1% + num2%

CASE "S": PRINT num1% - num2%

CASE "D": PRINT num1% / num2%

CASE "M": PRINT num1% * num2%

END SELECT

END

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you create a calculator on qbasic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What extension would a file saved in Qbasic have?

the extensions of qbasic are that, there are only 80 pixels to write in the qbasic


Who created the calculator?

Willim Seward Burroughs was the first to create a working calculator.


Why are rem statements important in qbasic programming?

qbasic is important because its technology


Why did Pascal create the first calculator in 1645?

nose


What is the shortcut key for input statement in QBasic?

There is no shortcut key of input in qbasic


What are the different types of operators in QBASIC?

The different types of operators in QBASIC are:Arithmetic OperatorsRelational OperatorsLogical Operators


What are the difference between gwbasic and qbasic?

Difference between QBASIC and GWBASIC?


What characteristics in quickbasic?

CHOICE OF EITHER 32 BIT/OR ELSE, 64 BIT QBASIC PROGRAM VERSIONS There are both 32 bit/64 bit QBASIC program versions. You have to select which is the correct version that will run on your own operating system. For example,... -&gt; Windows 95/98/XP, runs the 32 bit version(s) -&gt; Windows 7 runs the 64 bit version CHOICE OF EITHER QBASIC 'INTERPRETER'/OR ELSE, 'COMPILER' VERSIONS QBASIC Version 1.1 was the original version; however, it is 'interpreter' only. This means you CANNOT use it to create stand alone [.exe]cutable files with. QBASIC Version 4.5 is a 'compiler' version; which CAN be used to create stand alone [.exe]cutable files with. QB64 is the 64 bit 'compiler' version which runs on 64 bit platforms; it can also be used to create stand alone [.exe]cutable files with.


Why is QBasic called QuickBasic?

Qbasic and Quickbasic are not the same! Qbasic was a free interpreter that Microsoft included with MS-DOS. Although Quickbasic uses similar syntax as quickbasic it allows programs to be compiled.


Who found QBASIC?

microsoft


Do you need statement numbers in QBASIC?

Statement numbers were a feature of BASIC, and while QBASIC supports them, they are by no means necessary.


Advantage of qbasic?

The advantage of qbasic is that it is easy to learn, to start out,then one can move on to more complex, or advanced languages.