₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,224 members, 8,510,770 topics. Date: Saturday, 31 October 2026 at 02:29 AM

Toggle theme

Qbasic Programmers Please Help - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Qbasic Programmers Please Help (1013 Views)

1 Reply (Go Down)

Qbasic Programmers Please Help by anisylva(op): 8:25pm On Mar 12, 2015
please i need some help coding in qbasic,
1- write a program to read a set of real numbers and sort the numbers in desending order using bubble sort.
2- write a program that prints the index of the largest value stored in an array.
3- write a program to compute the sum of column elements of an array.
Re: Qbasic Programmers Please Help by HCpaul(m): 7:59am On Mar 15, 2015
Nairaland is not the best community for this. Only but a few programmers are still coding in QBasic today. There are many communities for QBasic online. I mean the espert in the language. Just try to search a little bit. Although, i would have help, but have dropped the language as it is limited in my target.
Re: Qbasic Programmers Please Help by elfico(m): 6:11pm On Mar 15, 2015
these questions are not very difficult., just google each one and am sure you would get a lot of anwsers. If you dont, then i can assist you.
Re: Qbasic Programmers Please Help by anisylva(op): 2:59am On Mar 16, 2015
tnx guys, i'm trying
Re: Qbasic Programmers Please Help by kudaisi(m): 5:20am On Mar 30, 2015
I employ to however study the code and understand how it works. Understanding qbasic is a learning platform for other programming languages. So it was for me anyway.
Re: Qbasic Programmers Please Help by kudaisi(m): 5:21am On Mar 30, 2015
Try this, I coded and tested it with qbasic 4.5 should work fine.

LET ITEMS = 100
DIM A(ITEMS)
LET LARGEST = 0
LET LARGESTINDEX = 0
RANDOMIZE TIMER / 3
PRINT "PRINTING UNSORTED LIST"

' CREATE RANDOM NUMBERS
' PRINT THE NUMBERS AS THERE ARE CREATED
' COMPARE THE NUMBERS FOR THE HIGHEST
FOR NUM = 1 TO ITEMS
LET A(NUM) = INT(26 * RND) + 25
PRINT A(NUM)
IF A(NUM) > LARGEST THEN
LARGEST = A(NUM)
LARGESTINDEX = NUM
END IF
NEXT NUM

'DO THE SORTING
FOR OUTER = 1 TO ITEMS - 1
PRINT OUTER;
FOR INNER = OUTER + 1 TO ITEMS
IF A(OUTER) <= A(INNER) THEN GOTO NOCHANGE
SWAP A(OUTER), A(INNER)
NOCHANGE:
NEXT INNER
NEXT OUTER

PRINT "SORTED LIST:"
FOR NUM = 1 TO ITEMS
PRINT A(NUM),
NEXT NUM

PRINT "THE INDEX OF THE LARGEST NUMBER IS"; LARGESTINDEX

FOR NUM = 1 TO ITEMS
LET SUM = SUM + A(NUM)
NEXT NUM
PRINT "THE SUM OF THE NUMBERS IS: "; SUM
END
Re: Qbasic Programmers Please Help by anisylva(op): 7:34am On Mar 30, 2015
tnx guys
1 Reply

Qbasic Programmers SOLVE THIS QUESTIONS • I'm Having A Problem With This Qbasic. Who Can Help? • Can Qbasic Interact With Any DBMS ? • 2 • 3 • 4

Test your word knowledge in this new game called "words countdown" • Learn To Code With An Online Instructor • Learn How To Build Websites,3d Games And Android Apps.. Start Right Now For Free