diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/Debug2.py b/Debug2.py new file mode 100644 index 0000000..84adda2 --- /dev/null +++ b/Debug2.py @@ -0,0 +1,47 @@ +@@ -1,27 +1,21 @@ +def score_to_letter_grade(grade): + if grade > 90: + return "A" + elif grade >= 87: + return "B+" + elif grade == 80: + return "B" + elif grade >= 77: + return "C+" + elif grade <= 70: + return "C" + elif grade >= 67: + return "D+" + elif grade >= 60: + return "D" +#function given in the question +def lone_sum(a, b, c): + #sum contain the sum of 3 values in a,b and c + sum = a + b + c + if a >= b: + return c + elif a == c: + return b + elif b == c: + return a + elif a == b and a == c and b == c: + return 0 + else: + return "F" + return sum + + +print("Grade of 90 should be A: " + score_to_letter_grade(90)) +print("Grade of 87 should be B+: " + score_to_letter_grade(87)) +print("Grade of 81 should be B: " + score_to_letter_grade(81)) +print("Grade of 77 should be C+: " + score_to_letter_grade(77)) +print("Grade of 70 should be C: " + score_to_letter_grade(70)) +print("Grade of 67 should be D+: " + score_to_letter_grade(67)) +print("Grade of 60 should be D: " + score_to_letter_grade(60)) +print("Grade of 59 should be F: " + score_to_letter_grade(59)) +#input the values of a, b and c from the user +a=int(input("Enter the value of a :")) +b=int(input("Enter the value of b :")) +c=int(input("Enter the value of c :")) +#function call +print(lone_sum(a,b,c) ) diff --git a/README.md b/README.md index f6a26f4..f3040ff 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,47 @@ # Project Title -One Paragraph of project description goes here. +This is a homework assignment for CNE 310 IT Project Management. When I execute this code it will draw a square and a triangle. ## Getting Started -These instructions will [do something] on your local machine for [development/experimentation/demo]. +These instructions will guide the turtles it introduces in Python on your local machine for experimenting how to draw some squares and triangles. ### Prerequisites -[Project] requires [software and version] to run, with [additional packages, libaries, or mods]. The commands below will [upgrade OS and install the prerequisites, or do something else] +A herd of turtle requires Python to run, with The commands below will form some figures in some shapes and colors. -``` -sudo apt update -sudo apt upgrade -sudo apt install package1 package2 ``` ## Running Once installed you can run the program with the following command +tess.forward(80) +tess.left(120) +tess.forward(80) +tess.left(120) +tess.forward(80) +tess.left(120) + ``` -python cna_demo.py + ``` Add any additional ways to run the program below ``` -python cna_demo.py test.txt +alex.forward(50) # make alex draw a square +alex.left(90) +alex.forward(50) +alex.left(90) +alex.forward(50) +alex.left(90) +alex.forward(50) +alex.left(90) + + + + ``` ## Thanks -Provide thank yous and attributions here. If someone helped you, you looked at another repository, or another article, provide it here. +I would like to thank you to Doc McDowell who is my classmate who helped me out with this assignment. diff --git a/debug.py b/debug.py new file mode 100644 index 0000000..040a603 --- /dev/null +++ b/debug.py @@ -0,0 +1,16 @@ +def lone_sum(a, b, c): + if a >= b: + return c + elif a == c: + return b + elif b == c: + return a + elif a == b and a == c and b == c: + return 0 + else: + return a+b+c + +print("lone_sum of 10, 10, 10 should be 0: " + str(lone_sum(10, 10, 10))) +print("lone_sum of 1, 2, 3 should be 6: " + str(lone_sum(1, 2, 3))) +print("lone_sum of 1, 2, 1 should be 2: " + str(lone_sum(1, 2, 1))) +print("lone_sum of 4, 5, 6 should be 15: " + str(lone_sum(4, 5, 6))) diff --git a/debug2.py b/debug2.py new file mode 100644 index 0000000..01fade0 --- /dev/null +++ b/debug2.py @@ -0,0 +1,27 @@ +def score_to_letter_grade(grade): + if grade > 90: + return "A" + elif grade >= 87: + return "B+" + elif grade == 80: + return "B" + elif grade >= 77: + return "C+" + elif grade <= 70: + return "C" + elif grade >= 67: + return "D+" + elif grade >= 60: + return "D" + else: + return "F" + + +print("Grade of 90 should be A: " + score_to_letter_grade(90)) +print("Grade of 87 should be B+: " + score_to_letter_grade(87)) +print("Grade of 81 should be B: " + score_to_letter_grade(81)) +print("Grade of 77 should be C+: " + score_to_letter_grade(77)) +print("Grade of 70 should be C: " + score_to_letter_grade(70)) +print("Grade of 67 should be D+: " + score_to_letter_grade(67)) +print("Grade of 60 should be D: " + score_to_letter_grade(60)) +print("Grade of 59 should be F: " + score_to_letter_grade(59)) \ No newline at end of file