summaryrefslogtreecommitdiff
path: root/3754/CH3/EX3.28/3_28.sce
blob: ab36212b7eeb2e9bf460ca594ccca839ff6d0b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
clear//

//Variables

Ps = 500.0                   //Power of stereo system (in watt)
Pa = 2400.0                  //Power of air conditioner (in watt)
t = 3                        //time (in hours) 

//Calculation

P = (Ps + Pa)/1000           //Total power consumed (in kilowatt)
W = P * t                    //Energy used (in kilowatthour)

//Result

printf("\n The energy used is  %0.3f  kWh.",W)