# QBASIC, Computers question 2

posted by .

Why do I keep getting a Type Mismatch error on this line? Also, when i click "View" to view my output screen its blank, so nothing is printing.... can so please help me resolve this?

PRINT USING D\$; NAM\$; VehicleType\$; DaysHeld; Miles; Charge

My Code:

'************************************
'* THIS PROGRAM IS TO CALCULATE CAR RENTAL REVENUE GENERATED *
'*************************************
'VARIABLE USED:
'T1\$, H1\$, H2\$, D1\$
'NAM\$ Customer Name
'VehicleType\$ Vehicle Type
'MILAGE Miles Traveled
'RATE Vehicle Rate
'DaysHeld Days Held
'TOTAL Total Revenue Generated Per Account
'Charge Charge for the car rental

'*************************************
'* PROGRAM MAINLINE *
'*************************************
CLS
GOSUB InitializeVariables
GOSUB CalculateTotal
END

'*************************************
'* INITILIZE VARIABLES *
'*************************************

InitializeVariables:
LET T\$ = " CAR RENTAL "
LET H\$ = " Customer Vehicle Days Miles Total Cost"
LET H\$ = " Name Type Held Traveled For Rental"
LET D\$ = "/ / ## #### ######"

'*************************************
'* PRINT HEADINGS *
'*************************************
PRINT
PRINT T1\$ 'Print Title Line
PRINT
PRINT H1\$ 'Print Column Heading, Line 1
PRINT H2\$ 'Print Column Heading, Line 2
PRINT
RETURN

' ********************************
' Calculate Total
' ********************************

CalculateTotal:
DO UNTIL NAM\$ = "END"
IF VehicleType\$ = "Compact" THEN
LET Cost = 10
LET Rate = .15
ELSEIF VehicleType\$ = "Intermediate" THEN
LET Cost = 20
LET Rate = .18
ELSE
LET Cost = 30
LET Rate = .22
END IF
LET Charge = Cost * DaysHeld + Rate * Miles
PRINT USING D\$; NAM\$; VehicleType\$; DaysHeld; Miles; Charge
LOOP
RETURN

'*************************************
'* READ DATA *
'*************************************

READ NAM\$, VehicleType\$, DaysHeld, MilesTraveled
DATA "Jones","Large",6,500
DATA "Smith","Compact",17,3000
DATA "Baker","Intermediate",8,250
DATA "Williams","Intermediate",4,1000
DATA "Winston","Large",3,500
DATA "END"
RETURN

'*************************************
'* END OF PROGRAM *
'*************************************

## Similar Questions

1. ### mssue can you please view

can you please view my last postage. i hope you can understand me. If you think i don't appreciate your help well let me tell you how greatful i am of having each and one of you tutors all i want is to feel clear about a topic that …
2. ### Calculus

(This problem uses a TI-89 calculator) Find the largest and smallest values of the following function on their given intervals: y=(cos x)^x [-1.5, 4.75] This is what I put in the calculator (home screen): fMin((cos(x))^x,x I -1.5 < …
3. ### art

Can some one please help me with this question. It is for an art class, and im having trouble with this paper. I don't understand what the terms mean. I have looked them up but i still don't get them. • View the Neoclassic piece, …
4. ### English

I only have one question on this script that I need help on. This script is different and is called NO SMOKING by jacinto benavente. It is pretty good. I actually found a link to this script and here it is: I can't actually post the …
5. ### PHI/105

In comparing the views of David Hume, Immanuel Kant, Georg Hegel, and Arthur Schopenhauer, which view of experience seems closest to how you view the world?
6. ### math

Please graph your response to question 2 on a separate piece of paper. When finished, click "submit" to view the correct answer. Graph each rational number on a number line. , -, 1.5, 0.4
7. ### art need help

1. This is the study of beauty and art. (1 point)ethics harmony unity aesthetics 2. This view refers to how realistic the subject is in a work of art. (1 point)object view critical view subject view photographic view 3. This view refers …
8. ### internet basics

seeing an error message on the screen after you click on a link or icon may indicate that your pc doesn't have the correct ?
9. ### internet basics

seeing an error message when you click on a link or icon may indicate that your pc doesn't have the correct what to view the information your looking for a.accessory,b.plug in,c.isp,d.dictionary
10. ### Technology

To insert clip art into a document, what step should I take immediately after i find the clip art I want to insert?

More Similar Questions