From e3f674733c56624fa9b8ce48fbb2bbba3fb166b1 Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 10 Jan 2025 15:12:25 -0700 Subject: Complete program 1 for project 2 --- projects/2/README.md | 3 ++- projects/2/prog1.py | 25 +++++++++++++++++++++++++ projects/2/prog2.py | 7 +++++++ projects/2/prog3.py | 7 +++++++ projects/2/prog4.py | 7 +++++++ 5 files changed, 48 insertions(+), 1 deletion(-) mode change 100644 => 100755 projects/2/prog1.py mode change 100644 => 100755 projects/2/prog2.py mode change 100644 => 100755 projects/2/prog3.py mode change 100644 => 100755 projects/2/prog4.py (limited to 'projects/2') 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 old mode 100644 new mode 100755 index e69de29..28e03f2 --- 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 old mode 100644 new mode 100755 index e69de29..cd8cd78 --- 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 old mode 100644 new mode 100755 index e69de29..7e390bd --- 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 old mode 100644 new mode 100755 index e69de29..dd0f49e --- 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 +""") -- cgit v1.2.3