answersLogoWhite

0


Best Answer

EXAMPLE 1 - LANGUAGE: QBASIC

'*** printing string literals...

CLS

PRINT "Laptop manufacturers:-"

PRINT

PRINT "Toshiba"

PRINT "Sony"

PRINT "Apple"

PRINT "Dell"

PRINT "Samsung"

END

EXAMPLE 2 - LANGUAGE: QBASIC

'*** printing string values from an array name variable...

DIM companyName$(5)

companyName$(1) = "Toshiba"

companyName$(2) = "Sony"

companyName$(3) = "Apple"

companyName$(4) = "Dell"

companyName$(5) = "Samsung"

CLS

PRINT "Laptop manufacturers:-"

PRINT

FOR eachCompanyNo% = 1 TO 5

PRINT companyName$(eachCompanyNo%)

NEXT

END

EXAMPLE 3 - LANGUAGE: QBASIC

'*** READing/and, PRINTing from DATA statements list...

CLS

PRINT "Laptop manufacturers:-"

PRINT

READ eachCompanyName$

DO WHILE eachCompanyName$<>"EOF"

PRINT eachCompanyName$

READ eachCompanyName$

LOOP

END

DATA "Toshiba","Sony","Apple","Dell","Samsung"

DATA "EOF"

*NOTE*: There are many more ways that it's possible to do this, too. Including...

-Storing data in an external text based file(.txt/.dat/.csv); then, opening/reading in/printing values from that external data file/closing the file.

-using fixed length strings/together with dot notation

-etc.

I will leave it up to you to go and discover how to use such further possibilities; and, more...

CONCLUSION

As you can see from the above code examples/suggestions; QBASIC, is a very highly versatile programming language; which, quite often, gives programmers multiple different ways to write their underlying 'source code'...though, each differently written program will produce exactly the same surface 'output'.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program in QBASIC to print the names of any 5 laptop companies?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you find the greater number in qbasic?

Give your numbers the names 'A' and 'B', and use these program lines. Whichever of the two numbers is greater will be printed. G = A If B &gt; A THEN G = B. PRINT "The greater number is "; G


What are the names of companies that offer pc laptops?

PC laptops are offered by hundreds of companies. The more well-known laptop manufacturers are Hewlett-Packard, Dell, Gateway, Samsung, Sony and Acer.


What are come reliable brand names for laptop computer batteries?

Many companies offer less expensive alternatives to original manufacturer brand name laptop batteries. These include PCMS, Duracell and others. Some users have commented on shorter battery life for generic laptop batteries.


What are the names of some of the companies who allow you to buy a laptop online?

Many of the manufacturers of laptops, electronics, and computer accessories maintain their own company websites for their products. You can purchase a laptop online from the website of the brand manufacturers or from sites like eBay or Amazon.


Provide some galvanized companies names?

provide some good names of galvanized companies


What are songs names for laptop commercial?

Too close


What names are suitable for both computer and laptop shop?

Laptech laptop world pc world laptronics


What are the names of some bvi companies?

The names of some BVI companies can vary depending on the dealings of the company. For example investments, holdings, trading, overseas and international can all be names of BVI companies.


How do you create a program that can input 100 names using flowchart?

create a program that can input 100 names


What are the names of student-run Columbia moving companies?

The names of the student-run Columbia moving companies are Student Moving and Columbia College Movers. Those are the names of the student-run moving companies.


Are program names such as teacher support program capitalized?

yes


What are the names of companies with no debt?

the companies having no debt are as GOOGLE, APPLE.