summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-01-10 15:12:25 -0700
committermo khan <mo@mokhan.ca>2025-01-10 15:12:25 -0700
commite3f674733c56624fa9b8ce48fbb2bbba3fb166b1 (patch)
tree5299b40dbc9a09f518013cad55dc5e696834f57a
parent41022a0f1bcd7c305915aba1a95aac5e7d8abff4 (diff)
Complete program 1 for project 2
-rw-r--r--projects/2/README.md3
-rwxr-xr-x[-rw-r--r--]projects/2/prog1.py25
-rwxr-xr-x[-rw-r--r--]projects/2/prog2.py7
-rwxr-xr-x[-rw-r--r--]projects/2/prog3.py7
-rwxr-xr-x[-rw-r--r--]projects/2/prog4.py7
5 files changed, 48 insertions, 1 deletions
diff --git a/projects/2/README.md b/projects/2/README.md
index 334e629..b240834 100644
--- a/projects/2/README.md
+++ b/projects/2/README.md
@@ -97,8 +97,9 @@ beginning to describe the function of the program. All programs should start
with a display of your name, student id#, and the program number and name.
When storing the files, name them as `prog1.py,` `prog2.py`, etc.
+### EXAMPLE OF AUTHOR/PROGRAM INFORMATION OUTPUT
+
```bash
-EXAMPLE OF AUTHOR/PROGRAM INFORMATION OUTPUT
Program author: B. Rubble
ID#: 1234567
diff --git a/projects/2/prog1.py b/projects/2/prog1.py
index e69de29..28e03f2 100644..100755
--- a/projects/2/prog1.py
+++ b/projects/2/prog1.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+print("""
+Program author: mo khan
+ID: 3431709
+Program 1 - Math Functions
+""")
+
+# Add two numbers and print the result
+print('ADDITION: 2+2={}'.format(2+2))
+
+# Subject one number from another and print the result
+print('SUBTRACTION: 4-2={}'.format(4-2))
+
+# Multiple two numbers and print the result
+print('MULTIPLICATION: 4*2={}'.format(4*2))
+
+# Divide one number from another and print the result
+print('DIVISION: 4/2={}'.format(4/2))
+
+# Compute the exponent and print the result
+print('EXPONENT: 2**3={}'.format(2**3))
+
+# Compute the remainder using modulus division and print the result
+print('REMAINDER: 5%2={}'.format(5%2))
diff --git a/projects/2/prog2.py b/projects/2/prog2.py
index e69de29..cd8cd78 100644..100755
--- a/projects/2/prog2.py
+++ b/projects/2/prog2.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+print("""
+Program author: mo khan
+ID: 3431709
+Program 2 - Using Input
+""")
diff --git a/projects/2/prog3.py b/projects/2/prog3.py
index e69de29..7e390bd 100644..100755
--- a/projects/2/prog3.py
+++ b/projects/2/prog3.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+print("""
+Program author: mo khan
+ID: 3431709
+Program 3 - Loops And If Conditions
+""")
diff --git a/projects/2/prog4.py b/projects/2/prog4.py
index e69de29..dd0f49e 100644..100755
--- a/projects/2/prog4.py
+++ b/projects/2/prog4.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+print("""
+Program author: mo khan
+ID: 3431709
+Program 4 - Functions
+""")