summaryrefslogtreecommitdiff
path: root/3802/CH14/EX14.5/Ex14_5.sce
blob: 32fed9c57bde9672548abd831751fc0db8e06172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Book Name:Fundamentals of Electrical Engineering
//Author:Rajendra Prasad
//Publisher: PHI Learning Private Limited
//Edition:Third ,2014

//Ex14_5.sce

clc;
clear;
tariff1=3.50;             //tariff in rupees per kilowatthour for first 500kilowatthour
tariff2=3.00;              //tariff in rupees per kilowatthour for next 500kilowatthour
tariff3=2.50;              //tariff in rupees per kilowatthour for usage exceeding 1000kilowatthour
days_in_a_month=31;
time_duration=24*days_in_a_month;
average_demand=2.5;                              //in kilowatt
monthly_consumption=time_duration*average_demand;
a1=500;               //kWh for tariff1
a2=500;                //kWh for tariff2
a3=monthly_consumption-a1-a2;          //kWh for tariff3
monthly_charge=(a1*tariff1)+(a2*tariff2)+(a3*tariff3);
printf("\n Monthly Charge=%d rupees.",monthly_charge)