summaryrefslogtreecommitdiff
path: root/comp/work/1
diff options
context:
space:
mode:
Diffstat (limited to 'comp/work/1')
-rwxr-xr-xcomp/work/1/areaCirc.py10
-rwxr-xr-xcomp/work/1/areaRect.py14
-rwxr-xr-xcomp/work/1/calcVAT6
-rwxr-xr-xcomp/work/1/fahToCel5
4 files changed, 35 insertions, 0 deletions
diff --git a/comp/work/1/areaCirc.py b/comp/work/1/areaCirc.py
new file mode 100755
index 0000000..5c5deac
--- /dev/null
+++ b/comp/work/1/areaCirc.py
@@ -0,0 +1,10 @@
+import math
+
+radius = float(input("radius of the circle: "))
+
+area = (math.pi) * (radius * radius)
+
+areaInPi = area / math.pi
+
+print("the area of a circle with a radius of", radius, "is", area, "(",areaInPi,"PI )")
+
diff --git a/comp/work/1/areaRect.py b/comp/work/1/areaRect.py
new file mode 100755
index 0000000..e96af85
--- /dev/null
+++ b/comp/work/1/areaRect.py
@@ -0,0 +1,14 @@
+print("This program calculates the area of a rectangle")
+
+length = float(input("Type in the length : "))
+
+width = float(input("Type in the width : "))
+
+perimeter = (length * 2) + (width *2)
+
+area = length * width
+
+print("The area of the rectangle with a length of", length, "and a width of", width, "is", area)
+print("The perimiter of the rectangle with a length of", length, "and a width of", width, "is", perimeter)
+
+
diff --git a/comp/work/1/calcVAT b/comp/work/1/calcVAT
new file mode 100755
index 0000000..bcebd93
--- /dev/null
+++ b/comp/work/1/calcVAT
@@ -0,0 +1,6 @@
+startingMoney = float(input("starting money: "))
+
+endingMoney = startingMoney - (startingMoney * 0.2)
+endingMoney = format(endingMoney, ".2f")
+
+print("you now have", endingMoney)
diff --git a/comp/work/1/fahToCel b/comp/work/1/fahToCel
new file mode 100755
index 0000000..e412c72
--- /dev/null
+++ b/comp/work/1/fahToCel
@@ -0,0 +1,5 @@
+inputTemp = float(input("Temprature in fahrenheit: "))
+
+convertedTemp = (5 / 9) * (inputTemp - 32)
+
+print("the converted temp is", convertedTemp)