Google Answers Logo
View Question
 
Q: QBASIC Simple program ( No Answer,   0 Comments )
Question  
Subject: QBASIC Simple program
Category: Computers > Programming
Asked by: higgins911-ga
List Price: $2.00
Posted: 15 Nov 2004 09:12 PST
Expires: 15 Nov 2004 20:59 PST
Question ID: 429236
Using QBASIC:

A. Using the following "data-list" containing twenty numbers, count
how many of the numbers are:
  1. Positive
  2. Negative
  3. Zero
 
B. Use "Read" and "Data" statements
 
DATA: 10,2,0,-6,5,72,60,61,4,-80,-14,90,89,100,-42,17,55,48,21
 
-need trip code ...make trip code last number

Run ...should look like this
                  Pos.       Neg.      Zero
                   15           4           1

Clarification of Question by higgins911-ga on 15 Nov 2004 09:15 PST
I need this by the end of the day Nov. 15th. Around 7pm Central time.

Clarification of Question by higgins911-ga on 15 Nov 2004 09:16 PST
This is what I came up with so far.

CLS
DIM posnum AS INTEGER
DIM negnum AS INTEGER
DIM zernum AS INTEGER
posnum = 0
negnum = 0
zernum = 0
IF X = -1 THEN GOTO NOMORE
FOR X = 1 TO 21
READ X
DATA 10,2,0,-6,5,72,60,61,4,-80,-14,90,89,100,-42,17,55,48,21,-1
FOR Y = 1 TO 21
NEXT Y
NEXT X
IF X > 0 THEN
posnum = posnum + 1
ELSEIF X < 0 THEN
negnum = negnum + 1
ELSEIF X = 0 THEN
zernum = zernum + 1
ELSE
PRINT "ERROR"
END IF
PRINT "POSTIVE     "; "NEGATIVE      "; "ZERO"
PRINT posnum, negnum, zernum
NOMORE:
END
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy