summaryrefslogtreecommitdiff
path: root/1415/CH1/EX1.3.5/ex5.sci
blob: e097bdffdfa16fd7b005caac6ab3cf313d87dfd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Example 6 Page 86
clc
clear

disp('a)')
s2=530//Assigning s2 values
s1=50//Assigning s1 values
t2=8//Assigning t2 values
t1=0//Assigning t1 values
m=((s2-s1)/(t2-t1));//calculating m value
disp(m,'the slope is:')//displaying m value
b=s1-m*t1;//calculating b value
disp(b,'the intercept value is')//displaying b value
mprintf( "So, %dt+%d million units ",m,b);//printing the s equation

disp('b)')
mprintf( "So, %dt+%d million units\n ",m,b);//printing the s equation
//since value of s=440
s=440//Assigning s values
m=60//Assigning m values
b=50//Assigning b values
t=(s-b)/60;//calculting time
mprintf("\nAnnual sales of mobile portable devices will reah 440 millions when s=440 or t=%f years",t);//displaying the time in years