answersLogoWhite

0

QBasic

QBasic is an integrated development environment (IDE) and interpreter for a variant of the BASIC programming language. QBasic includes a debugger with code modification and on-the-fly expression evaluation that can run under most versions of DOS, Windows, Linux and FreeBSD.

221 Questions

How do you download QBasic?

In order to Download Qbasic you may do one, both or none of these two things:

1.) Go to "http://www.softpedia.com/get/Programming/Coding-languages-Compilers/Qbasic.shtml" and click download

or

2.) use "Google.com" with the keywords Qbasic free download to find another website with a free qbasic downlaod.

Will you please tell the GWBASIC program for the multiplication of two arrays?

just type "chikosalovakia" on gw basic .......................it will give you all instructions............it is a special code.................

How is qbasics relevant to a persons life?

At first, the student learns programming code purely by reading up about it...programming history...which is also the story of hardware/software; different programming languages...in fact, 100's of different programming languages...with newer programming languages being invented, constantly, all the time; concepts: procedural/functional/imperative/object oriented/compiler/interpreter/operating systems; different kinds of programs: based on numbers/text/graphics/sound/-etc.

Next, they decide...yes, this computer science field seems to be really interesting; why not let me try giving it a go myself; first, by copying & pasting other people's example codes; then, running/executing these programs to see if they will work/or, not...???

Next, they have a go at learning to write their own code; naturally, as with learning most subjects to begin with, they will find themselves making MANY mistakes; each of these mistakes will need to be very patiently found/and, then, corrected in order to make their programs work, effectively. Sometimes, after making so many mistakes, repeatedly; they will end up feeling like being a 'total fool!'

The big difference between a 'successful' programmer/and, a 'failed' programmer; is not usually a question of how intelligent the person is; as, the truth is, anyone of just plain normal average intelligence is capable of learning 'the art of programming'. Instead, it's more related to how fully determined they are to stick with learning; no matter how many times their code fails; try, try, again...; and, then, of course, you will, eventually, succeed.

I myself can remember attempting to go write loads of programs which failed; sometimes, I must confess, that I just could not work out why/or else, got totally tired and fed up of trying to go figure it all out?! I either deleted the program, altogether/or else, attempted to either modify/or, re-write the code again starting from total scratch. Whether the program failed/or, RAN successfully; I was still very highly determined to continue along my programming journey.

Some people think that programmers have to be really good at maths; well, all the maths I know is just really simple maths, indeed; namely, how to add/subtract/divide/multiply; thus, people are surprised to know that although I practice doing programming an awful lot, even, daily; yet, I'm not very good at maths in terms of having any high level understanding; in never actually passed any high level exam such as GCSE maths/which is 'base' level maths which school children learn. I guess, I just enjoy understanding the 'logic' of it all. Whereas, real life isn't always entirely logical, at all...?!

A = 1 : B = 2: C = A+B

Q: What's C? A: 3

...this kind of problem I find I have no trouble at all understanding; and, in fact, do seem to understand it almost instinctively; just like a duck taking to water.

I think, that many programmers enjoy programming because, secretly, it makes them feel like being the 'master' who is always issuing commands to the 'slave' computer; and, therefore, who is always 'totally in control!'

You don't need to know a whole entire proramming language in order to be able to use it effectively. Let's say you wish to write a 12 x tables program; and, the language includes 1000's of codes; well, you don't need to go learn all of those 1000's of codes; instead, you just need to learn enough codes that will enable you to get by to be able to write your 12 x tables program, successfully; such as a mere handful of say around 10 or so codes should really be enough.

I must confess that in all my years of practicing doing programming; I never learned a single programming language entirely in full, yet; at the most, I tend to learn about 1/2 of it; though, most times, less than a 1/4; and, yet still I was able to use whichever programming language I learned to create a multitude of different programs which all worked.

In learning certain complex subjects; there is a point when you are a 'beginner'; and, then, you feel you are totally 'outside' of it all...; not quite fully understanding/more doing pure guess work, instead...??? Then, with plenty of time/patience/practice; then, you find that both your skills/understanding do slowly improve; and, you are now actually able to think in terms of the programming language itself; well, suddenly, you've gone and 'crossed the line', and, become an 'insider', now; that is the say that skill has actually become a part of you; just like your body limbs are: arms/feet/-etc.; you will take this skill around with you whereever it is you go in life; and, for all the rest of your entire lifetime to come.

You find that you are, now, actually 'living' being in the programming language...for all of 24/7/366. So, whenever you see a sum written down: 1+1, on a paper sheet/or else, on TV/or, you heard that sum being spoken out aloud; your immediate thoughts are to interpret this problem in terms of programming code...

PRINT 1+1

Or, if you see a game such as noughts and crosses/chess/monopoly/-etc. Then, your immediate thoughts are to interpret this problem in terms of programming code; how would I draw that board? So, you go and emulate trying to write/play the very same game on the computer; be it 'manual' version/or else, 'automatic' version; you might even try coming up with a novel version entirely of your own.

That is how learning a programming language can, ultimately, change you; and, for all the rest of your entire life. You no longer see/interpret the world as being quite the same anymore; instead, if you see a simple shape such as a box-linke shape...be it door/cigerette box/speaker box/TV box/chester draws box/skyscraper shaped like a box...and, immediately, you find yourself thinking in terms of programming code...how would I draw that rectangle shape/and, put together all 4 sides of the box/what about the top and bottom lids of the box, how would I simulate that; could I make the box into a 3D shape that turns/how to color in the boxes sides/what about shape/length/angles/texture/weight/-etc.

You have a timetable written down on a paper sheet; why not translate this into becoming computing code, instead; which could be stored in a more compact form on say a USB memory stick/or, the file uploaded, and, then, accessed over the net from off any internet connected computing device in the world; 24/7/366! Why don't I write a program to password protect my timetable file so that nobody can find it easily; or, even better still, why don't I write a program to encrypt the data itself...so that even if people do find it; they still won't be able to see/understand what the content means?!/-Etc.

And, so on...and, so on...in this sense...when relating 'real life' situation/problems to programming practices; a progammers thinking process never ever actually ends...! Programmers do actually see, and, experience this entire 'world'...in terms which relates back to programming codes; to them everything IS a program; or, could become contained inside of a program; providing they can understand the problem well enough to be able to break it down, step by step; and, thus, be able to define it, effectively.

How do you write a program in BASIC to find the GCD and LCM of two integer numbers?

#include<stdio.h>

#include<conio.h>

void main()

{

int x,y,z,i;

clrscr();

printf("Enter Two Numbers = ");

scanf("d%d",&x,&y);

for(i=1;i<=x*y*z;i++)

{

if(i%x==0&&i%y==0)

{

printf("LCM is %d\n",i);

break;

}

}

getch();

}

WAP To print the squares of all even numbers from 1 to 20?

CLS

PRINT "PROGRAM: Print squares of all even numbers from 1 to 20"

PRINT

PRINT "number", "squared"

PRINT

FOR number% = 1 TO 20

IF number% MOD 2 = 0 THEN

PRINT number%, number% * number%

END IF

NEXT

END

How do you write a program to find the area and perimeter of a rectangle?

CLS

PRINT "PROGRAM: Calculate both perimeter/area of rectangle"

PRINT

INPUT " Length"; length

INPUT "Breadth"; breadth

PRINT

PRINT "Perimeter: "; 2 * (length + breadth)

PRINT " Area: "; length * breadth

END

How do you generate 1 22 333 4444 55555 series in qbasic?

REMPATTERNS (not necessary)

CLS

FOR I = 1 TO 5 STEP +1

FOR J = 1 TO I STEP+1

PRINT J

NEXT J

PRINT

NEXT I

END

Hope you find this helpful :)

Write the program in qbasic and add two numbers?

Cls

input "enter two no.s ",a,b

sum=a+b

print "sum = ";sum

end

How do you create a calculator on qbasic?

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!"

Write an algorithm for bisection method?

#include[stdio.h]

#include[math.h]

#define epsilon 1e-6

void main()

{

double g1,g2,g,v,v1,v2,dx;

int found,converged,i;

found=0;

printf(" enter the first guess\n");

scanf("%lf",&g1);

v1=g1*g1*g1-15;

printf("value 1 is %lf\n",v1);

while (found==0)

{

printf("enter the second guess\n");

scanf("%lf",&g2);

v2=g2*g2*g2-15;

printf(" value 2 is %lf\n",v2);

if (v1*v2>0)

{found=0;}

else

found=1;

}

printf("right guess\n");

i=1;

while (converged==0)

{

printf("\n iteration=%d\n",i);

g=(g1+g2)/2;

printf("new guess is %lf\n",g);

v=g*g*g-15;

printf("new value is%lf\n",v);

if (v*v1>0)

{

g1=g;

printf("the next guess is %lf\n",g);

dx=(g1-g2)/g1;

}

else

{

g2=g;

printf("the next guess is %lf\n",g);

dx=(g1-g2)/g1;

}

if (fabs(dx)'less than' epsilon

{converged=1;}

i=i+1;

}

printf("\nth calculated value is %lf\n",v);

}

What is the function key to execute Qbasic program?

QBASIC operators are listed as follows.../along with some example QBASIC code...

->LOGICAL OPERATORS

AND

OR

NOT

EXAMPLE QBASIC CODE:-

A=1

B=1

IF (A AND B) THEN PRINT "Result: True" ELSE PRINT "Result: False"

...output...

Result: True

A=1

B=2

IF (A AND B) THEN PRINT "Result: True" ELSE PRINT "Result: False"

...output...

Result: False

-> MATHEMATICAL OPERATORS

+ plus

- minus

* multiply

/ divide

MOD division remainder

^ raise to the power

EXAMPLE QBASIC CODE:-

num1=4

num2=2

PRINT num1 + num2

PRINT num1 - num2

PRINT num1 * num2

PRINT num1 / num2

PRINT num1 MOD num2

PRINT num1 ^ num2

...output...

6

2

8

2

0

16

-> COMPARISON OPERATORS

= equals

> greater than

< lesser than

>= greater than/or, equals

<= lesser than/or, equals

<> not

EXAMPLE QBASIC CODE:-

num1 = 6

num2 = 8

IF num1 = num2 THEN PRINT "Equal to"

IF num1 > num2 THEN PRINT "Greater than"

IF num1 < num2 THEN PRINT "Lesser than"

IF num1 >= num2 THEN PRINT "Greater than/or, equal to"

IF num1 <= num2 THEN PRINT "Lesser than/or, equal to"

IF num1 <> num2 THEN PRINT "NOT equal"

...output...

Lesser than

Lesser than/or, equal to

NOT equal

How you draw a circle in qbasic?

You need the screen coordinates of the end-points. That's another whole topic.

Say the end-points are (A,B) and (C,D).

To draw a solid line connecting these points:

LINE (A,B) - (C,D)

What is the difference between an inactive file and dead file?

Active file: An active file is where you use a file quite frequently.

Inactive file: A file that you use but not as frequently.

Dead file: A dead file is where you don't use the file at all and is stored in your archives

Write a qbasic program to display the multiplication tables from 1 to 10?

Writing this QBASIC code purely on the fly...; without actually testing out if it works/or, not...

CLS

FOR tablesNo%=1 TO 10

FOR timesNo%=1 TO 10

PRINT timesNo%*tablesNo%; " ";

NEXT

PRINT

NEXT

END

NOTE: The numbers are not yet formatted to line up perfectly straight with one another.

How do you underline text with stars in qbasic?

strText$ = "Some text to be underlined."

CLS

PRINT strText$

PRINT STRING$(LEN(strText$), "*")

What is the HTML code for enter?

Use <br /> for a new line. Use <p></p> for a new paragraph.

or if you want to link to a website or another page you put

<html>

<body>

<a href="the page or site you want to link">button text here</a>

</body>

</html>

How do you write a magic square program with basic?

Answer

You're better off using a program like Visual Basic or C++ to do that. QBasic doesn't have very many capabilities.


AnswerQBasic is quite capable. It is certainly capable of solving a magic squares problem.

How do you make binary to decimal converter in G W BASIC?

First of all we will talk about how binary number are converted back into decimal representation and later we will have program.

Here is the formula of this transformation:

Binary number: a3a2a1a0

Decimal number a x 23 + a x 22 + a x 21 + a x 20

Example:

Binary: 1101

Decimal: 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 8 + 4 + 0 + 1 = 13

And here we have our program:

#include

#include

#include

int main() {

char str[100];

int ind;

int sum = 0;

printf("Please enter binary number: ");

scanf("%s", str);

for(ind = 0; ind < strlen(str); ind++) {

sum += (str[ind] - 0x30) * pow(2, strlen(str) - ind - 1);

}

printf("Number in decimal would be %d\n", sum);

return 0;

}

Testing:

Please enter binary number: 1101

Number in decimal would be 13

Please enter binary number: 10000001

Number in decimal would be 129

Please enter binary number: 11111111

Number in decimal would be 255

Please enter binary number: 0

Number in decimal would be 0

What is the default screen mode of Qbasic?

The default screen mode for Qbasic is 0.

What basic programming languages did Bill Gates develop?

No. BASIC was the brainchild of John G. Kemeny and Thomas E. Kurtz in 1964. Bill Gates' contribution, along with Paul Allen, was to develop a BASIC interpreter for the MITS Altair 8800 in 1975.

What are the design principles in BASIC programming language?

4.1 Design Tradeoffs

Conceptual design involves a series of tradeoff decisions among significant parameters - such as operating speeds, memory size, power, and I/O bandwidth - to obtain a compromise design which best meets the performance requirements. Both the uncertainty in these requirements and the important tradeoff factors should be ascertained. Those factors which can be used to evaluate the design tradeoffs (usually on a qualitative basis) include:

  • Reliability
  • Expandability
  • Programmability
  • Maintainability
  • Compatibility
  • Adaptability
  • Availability
  • Development Status and Cost

Recommended practices for achieving reliability are given in section 4.5. The remainder of these features are discussed below.

Expandability measures the computer system's ability to conveniently accommodate increased requirements by higher speed or by physical expansion, without the cost of a major redesign (ref. 84). The original design of the computer should provide for this type of growth, especially with regard to the memory and I/O sections. The general procedure is to determine all the functions that foreseeably could be demanded of the computer system, such as by reviewing growth problems of past programs, and to establish a range of possible requirements for each of the functions, which may double the present requirement. If possible, the likelihood of these expanded requirements should also be estimated. Modularity is a desirable method for providing expandability and should be incorporated whenever feasible.

Prorgrammability, or the ease of programming the computer, should be considered early in the design. Past experience has shown that a balance between programming simplicity and hardware complexity is essential to prevent the costs of programming from becoming overwhelming. For example, sufficient memory capacity should be provided to accommodate program changes necessitated by increased performance or mission requirements; memory architecture should be designed to facilitate programming; and hard-wired memories should be avoided if many program changes are anticipated, because of the time and cost involved in implementing the changes. Adequate addressing facilities without artificial boundaries and a simple subroutine linkage are recommended. Considerations of programmability should include the efficiency of the source language, of the object code, and of converting from the source language to the object code, and the ease of using the source language and obtaining a completely coded computer program. If the computer is to be programmed in flight, the use of a compiler should be considered. A standard programming language, such as JOVIAL, SPL, or CLASP, is desirable and should be utilized for future applications if available. The degree of software sophistication and the availability of support software should be considered during the design.

Maintainability should not be neglected when designing the computer. Repair should be readily accomplished during ground operation, and if inflight maintenance is desired, this should be specified as a design requirement. Inflight repair or reconfiguration is closely associated with reliability and, as such, the extent of reconfiguration made possible will be dependent upon the reliability required. Malfunctions can often be detected by self-check programs; inflight repair can be effected by automatic switching, or by manual operation on manned missions. The tradeoff should consider the use of a degraded mode of operation. Generally, the recommended prelaunch maintenance procedure is to remove bad components or subsystems from the system and replace them with backup equipment. To facilitate manual maintenance, subassemblies should be pluggable, require a minimum of disassembly for access, and be replaceable without adjustment. The design should provide case of accessibility and should minimize the possibility of damage to other parts during maintenance. If replaced assemblies are to be discarded rather than repaired, maximum cost goals for a replaceable module should be established.

Compatibility should be developed between the computer and its interfaces, software, power levels, and, where necessary, ground computers. Standard interfaces and power levels should be implemented. Interface compatibility reduces the need for data conversion with peripheral equipment and is highly recommended. Data compatibility between models of a computer family should be provided to simplify the design of peripheral equipment. This consideration is particularly important when computers of different performance and architecture are interconnected. Source and object code compatibility between the spaceborne and ground-based computers is advantageous to facilitate programming.

Adaptability is defined as the ability of the system to meet a wide range of functional requirements without requiring physical modification. Adaptability is needed when requirements are not well defined or if it is anticipated that the computer will be applied to a variety of missions and/or a number of space vehicles. Although this is similar to the need for growth discussed under "expendability," in this case, potential requirements should be anticipated by providing reserves in memory capacity, computational speed, word length, and I/O capability. Moreover, the design should consider specific features which allow tailoring a basic machine to different situations, such as an adjustable word length through byte organized operations, alterable or unused operation codes, reserved fields within formats, and adjustable speed. Caution must be taken that the increase in computer capabilities is in accordance with other development considerations.

Availability is the probability that the computer is operating satisfactorily at a given time. It is closely related to reliability and repair time and should be considered in establishing reliability requirements. Since it takes into account the time required for malfunction detection and reconfiguration or repair, availability is particularly important during time-critical mission phases.

Development Status and Cost are complex management-related factors which can have significant effects on the design. They require the estimation of a number of items such as the extent of off-the-shelf hardware use, design risks in developing new equipment using advanced technologies, potential progress in the state of the art during the design and development of the computer, etc. In estimating cost, the manager should consider the total long-range expenditures as well as initial outlays, and also the cost of potential delays in developing advanced techniques, etc.

In addition to the above qualitative factors, tradeoffs should be determined on the basis of specified quantitative factors, such as precision, speed, capacity, weight, volume, and power.