QB / QB64 Discussion Forum      Other Subforums, Links and Downloads
 

 Return to Index  

Unscramble This Code to make it run

March 30 2010 at 10:17 AM
Anthony  (Login anthony1258)

 

CLS
initalize:
'Print "in intialize routine..."
PRINT TAB(20); "inflation gauge report"
PRINT
PRINT " ", "current", "inflation", "price"
PRINT "item", "price", "rate%", "in 1 yr."
PRINT "----", "-----", "------", "------"
RETURN
GOSUB initialize
GOSUB wrap.up
END
process:
'Print "in the process reutine..."
READ item$, cprice, pprice, numweeks
DO WHILE item$ <> "EOF"
pricechange = (cprice - pprice) / numweeks * 52
GOSUB process
airate = pricechange / pprice
PRINT USING "\ \ #,###.## ###.## #,###.##"; item$; cprice; airate; eprice
eprice = cprice + airate * cprice
airate = airate * 100' make airate display as a percentage
READ item$, cprice, pprice, numweeks
LOOP
RETURN
wrap.up

'**********DATA FOLLOWS**********
DATA 1doz. eggs,0.98,0.84,13
DATA 1lb. butter,1.70,1.62,14
DATA 1gal. milk, 2.20, 2.09, 17

 
 Respond to this message   
Responses

 Copyright © 1999-2018 Network54. All rights reserved.   Terms of Use   Privacy Statement