Convert to present value

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
vrozos
Posts: 63
Joined: Mon Nov 21, 2011 12:36 pm
Location: Athens, Greece
Contact:

Convert to present value

This is a tool for converting past values to present.
For example, Oric 1 was being sold in 1983 for 169
pounds. What is the present value?

The user needs to define the inflation rate from
1950 to present in lines 20-80, to define the present
year in line 110 and the conversion ratio from local
currency to euro in case of eurozone country (line 10).

The following lines are for the UK. Data for the UK were
taken from http://www.whatsthecost.com/historic.cpi.aspx.
The data for France, Spain, Norway and Greece will be
provided shortly.

1 REM Local currency to euro in 10.
10 DATA 1
20 DATA 3.1,9.1,9.2,3.1,1.8
25 DATA 4.5,4.9,3.7,3,0.6
30 DATA 1,3.4,4.3,2,3.3
35 DATA 4.8,3.9,2.5,4.7,5.4
40 DATA 6.4,9.4,7.1,9.2,16
45 DATA 24.2,16.5,15.8,8.3,13.4
50 DATA 18,11.9,8.6,4.6,5
55 DATA 6.1,3.4,4.2,4.9,5.2
60 DATA 7,7.5,4.3,2.5,2
65 DATA 2.6,2.5,1.8,1.6,1.3
70 DATA 0.8,1.2,1.3,1.4,1.3
75 DATA 2.1,2.3,2.3,3.6,2.1
80 DATA 3.2,4.4,0,0,0
100 REM --------------------
110 EY=2012
115 DIM N(EY-1950)
125 FOR I=1 TO EY-1950
135 NEXT
140 INPUT "Amount of money"; MN
145 INPUT "Year (1950-present)"; YR
150 IF YR<1950 OR YR>EY THEN 145
155 FOR I=YR TO EY-1
160 MN = MN*(100+N(I-1950+1))/100
165 NEXT
170 IF YR<2002 THEN MN=MN/RATIO
180 PRINT "Present value is "MN
Last edited by vrozos on Mon Apr 09, 2012 9:56 pm, edited 3 times in total.

Dbug
Posts: 2605
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Convert to present value

For those of you who want to try this program, just know that you do not have to type it by hand on the Oric (on in an emulator), you can use BAS2TAP.EXE to convert the text file directly to a TAP file that can be loaded on the Oric.

If you don't have it, you can download the OSDK and check the samples/basic folder for examples of how it works.

vrozos
Posts: 63
Joined: Mon Nov 21, 2011 12:36 pm
Location: Athens, Greece
Contact:

Re: Convert to present value

This is the data for France. Values for inflation were taken from

http://france-inflation.com/inflation-depuis-1901.php

10 DATA 6.56
20 DATA 10,16.3,11.9,-1.8,0.5
25 DATA 1,4.3,2.9,15.2,6
30 DATA 3.8,3.3,4.8,4.8,3.4
35 DATA 2.5,2.7,2.7,4.5,6.5
40 DATA 5.2,5.7,6.2,9.2,13.7
45 DATA 11.8,9.6,9.4,9.1,10.8
50 DATA 13.6,13.4,11.8,9.6,7.4
55 DATA 5.8,2.7,3.1,2.7,3.6
60 DATA 3.4,3.2,2.4,2.1,1.7
65 DATA 1.7,2,1.2,0.7,0.5
70 DATA 1.7,1.7,1.9,2.1,2.1
75 DATA 1.8,1.6,1.5,2.8,0.1
80 DATA 1.5,2.1,0,0,0

V.

vrozos
Posts: 63
Joined: Mon Nov 21, 2011 12:36 pm
Location: Athens, Greece
Contact:

Re: Convert to present value

This is the data for Spain. Data from 1980 till present was taken from:
http://www.indexmundi.com/spain/inflati ... es%29.html.

The data from 1955 up to 1979 was derived from the image provided at
http://www.global-rates.com/economic-in ... spain.aspx
The data was digitized with engauge and was interpolated and reshaped in Octave using
inpterp1 with 'nearest' and reshape functions. No data before 1955 were found so the inflation
for the years 1950-1955 was kept constant equal to 5%.

10 DATA 166.39
20 DATA 5.00, 5.00, 5.00, 5.00, 5.00
25 DATA 5.00, 9.69,12.69,12.35, 1.15
30 DATA 0.92, 4.15,11.19, 2.77,16.15
35 DATA 6.35, 6.46, 5.77, 0.58, 3.69
40 DATA 7.62, 8.42,11.19,13.50,17.54
45 DATA 19.62,21.35,26.77,16.04,16.50
50 DATA 15.58,14.55,14.42,12.17,11.28
55 DATA 8.81, 8.80, 5.25, 4.84, 6.79
60 DATA 6.72, 5.93, 7.14, 4.57, 4.72
65 DATA 4.67, 3.60, 1.88, 1.76, 2.23
70 DATA 3.48, 2.83, 3.59, 3.10, 3.05
75 DATA 3.38, 3.56, 2.84, 4.13,-0.24
80 DATA 2.04, 3.20, 0, 0, 0

V.

vrozos
Posts: 63
Joined: Mon Nov 21, 2011 12:36 pm
Location: Athens, Greece
Contact:

Re: Convert to present value

These are the data for Norway. For metadata information see Spain above.

10 DATA 1
20 DATA 5.00, 5.00, 5.00, 5.00, 5.00
25 DATA 5.00, 4.11, 2.47, 6.35,-0.09
30 DATA -0.09, 3.99, 4.12, 3.07, 5.43
35 DATA 2.09, 4.39, 4.45, 3.07, 5.97
40 DATA 12.40, 4.92, 7.09, 7.68,11.16
45 DATA 9.78, 8.01, 9.46, 5.19, 7.49
50 DATA 10.91,13.66,11.32, 8.41, 6.31
55 DATA 5.65, 7.19, 8.72, 6.68, 4.54
60 DATA 4.13, 3.42, 2.35, 2.29, 1.40
65 DATA 2.45, 1.25, 2.58, 2.27, 2.33
70 DATA 3.09, 3.02, 1.29, 2.48, 0.47
75 DATA 1.52, 2.33, 0.73, 3.77, 2.17
80 DATA 2.40, 1.30, 0 , 0 , 0

vrozos
Posts: 63
Joined: Mon Nov 21, 2011 12:36 pm
Location: Athens, Greece
Contact:

Re: Convert to present value

These are the data for Greece. Data was taken from www.global-rates.com.

10 DATA 340.75
20 DATA 5.00, 5.00, 5.00, 5.00, 5.00
25 DATA 5.00, 6.40, 1.34, 3.33, 1.39
30 DATA 1.37, 2.14, 0.47, 2.69, 1.50
35 DATA 1.24, 4.35, 4.67,-0.87, 2.60
40 DATA 2.41, 3.17, 3.00, 6.58,30.47
45 DATA 14.37,15.10,11.09,13.21,13.70
50 DATA 24.75,24.32,21.42,19.98,18.31
55 DATA 19.34,23.17,16.39,13.45,13.75
60 DATA 20.48,19.51,15.89,14.38,10.87
65 DATA 8.82, 7.87, 5.44, 4.52, 2.15
70 DATA 2.90, 3.65, 3.92, 3.44, 3.02
75 DATA 3.48, 3.31, 2.99, 4.24, 1.13
80 DATA 4.10, 3.34

Who is online

Users browsing this forum: No registered users and 3 guests