summaryrefslogtreecommitdiff
path: root/1415/CH1/EX1.2.3/ex3.sce
blob: 81c171e8e19823c3f259d709e748a2879ce285b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//Example 3 Page no 60
clc
clear
//creating function
function q=f(p)
    q=77.8*p^(-0.11)
endfunction

disp('a)')
//plotting demand function
disp('the demand curve is as in the graph')
p=([200 400 500 800 1200 1600 2000 2200])
y=f(p)
plot(2400,50,p,y,'blue')//plotting graph

disp('b)')
//the demand at tuition costs of $1000 and $1500
disp('the demand at tuition costs of $1000 and $1500')
q=f(1000)//funcition calling
mprintf("\t%f thousand students\n",q)
q=f(1500)//funcition calling
mprintf("\t%f thousand students\n",q)
//the change in demand is therefore given as
disp('the change in demand is therefore given as')
change=(f(1500)-f(1000))//funcition calling
mprintf("\t%f thousand students\n",change)
xtitle('Technology formula','p','q');