summaryrefslogtreecommitdiff
path: root/Basic_Engineering_Mathematics_by_John_Bird/CH5
diff options
context:
space:
mode:
Diffstat (limited to 'Basic_Engineering_Mathematics_by_John_Bird/CH5')
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.1/Ex5_1.R7
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.10/Ex5_10.R19
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.12/Ex5_12.R20
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.14/Ex5_14.R15
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.15/Ex5_15.R12
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.18/Ex5_18.R14
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.21/Ex5_21.R15
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.23/Ex5_23.R8
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.4/Ex5_4.R10
-rw-r--r--Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.7/Ex5_7.R10
10 files changed, 130 insertions, 0 deletions
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.1/Ex5_1.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.1/Ex5_1.R
new file mode 100644
index 00000000..e9e1d0ce
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.1/Ex5_1.R
@@ -0,0 +1,7 @@
+#page no.36
+#problem 1
+#laod package ------->formattable
+library(formattable)
+#function used: percent()
+n = 0.015 #decimal to percentage
+percent(n)
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.10/Ex5_10.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.10/Ex5_10.R
new file mode 100644
index 00000000..b0f3602d
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.10/Ex5_10.R
@@ -0,0 +1,19 @@
+#page no.37
+#problem 10
+#function:
+#percentage of given quantity
+percent_of_quantity = function(x,y) # x---->percenatge, y----->quantity
+{
+ return((percent2deci(x))*y)
+}
+
+percent2deci = function(x)
+{
+ return(x/100)
+}
+
+#given:
+p = 27 #percentage
+n = 65 # amount of money
+result = percent_of_quantity(p,n)
+print(result) \ No newline at end of file
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.12/Ex5_12.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.12/Ex5_12.R
new file mode 100644
index 00000000..bd18d448
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.12/Ex5_12.R
@@ -0,0 +1,20 @@
+#page no.38
+#problem 12
+#function:
+#percentage of given quantity
+percent_of_quantity = function(x,y) # x---->percenatge, y----->quantity
+{
+ return((percent2deci(x))*y)
+}
+
+percent2deci = function(x)
+{
+ return(x/100)
+}
+
+#given:
+cost = 190 #base price of ipod
+VAT = 20 # VAT percentage
+VAT1 = percent_of_quantity(VAT,cost)
+result = VAT1 + cost #total cost of iPod (VAT+BASE price)
+print(result) \ No newline at end of file
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.14/Ex5_14.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.14/Ex5_14.R
new file mode 100644
index 00000000..2bcba223
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.14/Ex5_14.R
@@ -0,0 +1,15 @@
+#page no.38
+#problem 14
+#load package ---->measurements
+library(measurements)
+#functions:
+percent_one_wrt_second = function(x,y)
+{
+ return(percent(x/y))
+}
+#given:
+t1 = 47 #time in minutes
+t2 = 2 #time in hours
+t2 = conv_unit(t2,'hr','min')
+result = percent_one_wrt_second(t1,t2)
+print(result) \ No newline at end of file
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.15/Ex5_15.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.15/Ex5_15.R
new file mode 100644
index 00000000..6636c188
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.15/Ex5_15.R
@@ -0,0 +1,12 @@
+#page no. 38
+#problem 15
+#function:
+percent_change = function(n,o) #n----> new value, o----> original value
+{
+ return(percent((n-o)/o))
+}
+#given:
+new_value = 52 #resistor value
+original_value = 45 #resistor value increases
+change = percent_change(new_value,original_value)
+print(change) \ No newline at end of file
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.18/Ex5_18.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.18/Ex5_18.R
new file mode 100644
index 00000000..6457c222
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.18/Ex5_18.R
@@ -0,0 +1,14 @@
+#page no. 39
+#problem 18
+#function:
+per_error = function(err,val) #err-->error, val ---> correct value
+{
+ return(percent(err/val))
+}
+
+#given:
+cal_vol = 50 #calculated voltage
+ac_vol = 50.4 #actual voltage
+error = ac_vol - cal_vol # error in measurements
+result = per_error(error,ac_vol) #percentage error
+print(result)
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.21/Ex5_21.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.21/Ex5_21.R
new file mode 100644
index 00000000..b0b5b75a
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.21/Ex5_21.R
@@ -0,0 +1,15 @@
+#page no. 40
+#problem 21
+#formula used:(new value/100-+change%)*100%
+#function:
+original_value_profit = function(new,change) #new----> new value, change in percentage
+{
+ return((new/(100+change))*100)
+
+}
+
+#given:
+c = 40 #change in percentage (profit)
+SP = 630# selling price ---->new value
+result = original_value_profit(SP,c) #cost to dealer
+print(result) \ No newline at end of file
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.23/Ex5_23.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.23/Ex5_23.R
new file mode 100644
index 00000000..67b55368
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.23/Ex5_23.R
@@ -0,0 +1,8 @@
+#page no. 40
+#problem
+#formula used: new value = (100 + %increase)*original value/100
+#given:
+inc = 6.5 #price increased in percentage
+cost = 2400 #original cost of boiler
+new_price = (((100 + inc)*cost)/100) #new price of boiler
+print(new_price) \ No newline at end of file
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.4/Ex5_4.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.4/Ex5_4.R
new file mode 100644
index 00000000..39bdfbbc
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.4/Ex5_4.R
@@ -0,0 +1,10 @@
+#page no.36
+#problem 4
+#function used:
+percent2deci = function(x)
+{
+ return(x/100)
+}
+#given:
+n = 17.5 # percentage
+print(percent2deci(n))
diff --git a/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.7/Ex5_7.R b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.7/Ex5_7.R
new file mode 100644
index 00000000..fde3d0cd
--- /dev/null
+++ b/Basic_Engineering_Mathematics_by_John_Bird/CH5/EX5.7/Ex5_7.R
@@ -0,0 +1,10 @@
+#page no.36
+#problem 7
+#laod package ------->formattable
+library(formattable)
+#function used: percent()
+n1 = 57/79 #fraction to percentage
+n2 = 49/67 #fraction to percentage
+
+percent(n1)
+percent(n2)