0% found this document useful (0 votes)
3 views

Programming Assignment 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Programming Assignment 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Week four

PROGRAMMING ASSIGNMENT FOUR

PART ONE
1. Step1: Define the function and input parameters

def hypotenuse (opposite, adjacent):


pass

#Step 2: Introduce Pythagorean theorem (hypotenuse = (opposite^2 + adjacent ^2) ^0.5

def hypotenuse (opposite, adjacent):


hypotenuse = (opposite ** 2 + adjacent ** 2) ** 0.5
return hypotenuse

#Stage 3: Input validation and error handling

def hypotenuse (opposite, adjacent):


if opposite <= 0 or adjacent <= 0:
return "Invalid input: Lengths of opposite and adjacent should be greater than zero."
else:
hypotenuse = (opposed ** 2 + adjacent ** 2) ** 0.5
return hypotenuse

#Stage 4: Test the function with opposite 3cm and adjacent 4cm.

# Test argument 1: Right triangle with opposite =3cm and adjacent =4cm
result1 = calculate_hypotenuse(3, 4)
print(result1)

Output
0.5

# Test argument 2: Right triangle with opposite =6cm and adjacent =7cm
Result2 = calculate_hypotenuse(6, 7)
print(result2)

Output
9.219544457292887

# Test argument 3: Right triangle with opposite =18cm and adjacent = 25 cm


Result3 = calculate_hypotenuse(18, 25)
print(result3)

Output
30.805843601498726
PART TWO
:

Introduction
Hello, my name is Patamiah Elorm Godwin, and I am a software developer and I build things for the
web.
I am a software developer specialized in building and occasionally designing exceptional digital
experiences. Currently I am focused on building accessible, reliable and cost-effective human-
centered web applications and softwares with Code.xe Ghana.

Projects
E-commerce Website Development
Description: Developed a fully functional e-commerce website using Python and Django framework.
Implemented features such as user authentication, product catalog, shopping cart, payment gateway
integration, and order management.
Technologies used: Python, Django, HTML/CSS, JavaScript, PostgreSQL
Contributions: Led the development team, designed the database schema, implemented the
backend logic, and collaborated with frontend developers for seamless integration.

Mobile App for Task Management


Description: Created a mobile app for task management that allows users to create, assign, and track
tasks. Implemented features like push notifications, task prioritization, and real-time updates using
React Native and Firebase.
Technologies used: React Native, Firebase, JavaScript, Redux
Contributions: Developed the frontend interface, integrated with Firebase for real-time updates,
implemented push notifications using Firebase Cloud Messaging, and conducted extensive testing for
performance and usability.

Company website
Description: Developed a fully functional company website using python, javascript framework
implemented feature such as menus, header, blog, enrollment, and employment and other useful
parts.
Technologies used: HTM/CSS, javascript, python, Django and Mysql.
Contributions: Developed the frontend interface, integrated the backend logic.

Skills
Web development
Software developer
Database
AI graphics developer
HTML/CSS
JAVASCRIPT
JAVA
C++
PYTHON
MYSQL

Experience
Code.xe Ghana- Web developer, Graphics designer, Software developer
Beulahland Christian School- Web Developer and programming instructor.
Education
UNIVERSITY OF THE PEOPLE: Computer science
BYU-IDAHO : Programming and web development
ACCRA INSTITUTE OF TECHNOLOGY: Computer engineering
VSL CONCEPTS : Web development

Contact Information
Tel: 0560477204
Email: [email protected]
LinedIn: Patamia Godwin

Function to find the average of a group of numbers

#Define the function signature

def calculate_average(numbers):
pass
#Calculate the sum of the numbers

def calculate_average(numbers):
total = 0
for number in numbers:
total += number
pass

#Calculate the length of the numbers list

def calculate_average(numbers):
total = 0
count = 0
for number in numbers:
total += number
count += 1
pass

# Calculate the average by dividing the sum by the count

def calculate_average(numbers):
total = 0
count = 0
for number in numbers:
total += number
count += 1
average = total / count
pass

# Return the average from the function

def calculate_average(numbers):
total = 0
count = 0
for number in numbers:
total += number
count += 1
average = total / count
return average

You might also like