summaryrefslogtreecommitdiff
path: root/3754/CH3/EX3.28/3_28.sce
diff options
context:
space:
mode:
Diffstat (limited to '3754/CH3/EX3.28/3_28.sce')
-rw-r--r--3754/CH3/EX3.28/3_28.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/3754/CH3/EX3.28/3_28.sce b/3754/CH3/EX3.28/3_28.sce
new file mode 100644
index 000000000..ab36212b7
--- /dev/null
+++ b/3754/CH3/EX3.28/3_28.sce
@@ -0,0 +1,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)