With this assignment you will demonstrate:
Please:
Work in teams of 1 to 4 students.
Do all work in the GitHub repository you created in the previous assignment.
Remember: There must be only one official repository per group.
Add files according to the folder structure below. You will be implementing the assigned functions and classes from scratch. The test files have been written for you; follow the links to obtain them.
. ├── code/ │ ├── python/ │ │ ├── exercises.py │ │ └── exercises_test.py │ ├── javascript/ │ │ ├── exercises.js │ │ └── exercises.test.js │ ├── lua/ │ │ ├── exercises.lua │ │ └── exercises_test.lua
Implement—for Lua, Python, and JavaScript—modules that contain:
#.
say("Hello")("my")("name")("is")("Colette")()
"Hello my name is Colette"
say()
""
Further instructions can be found in the unit tests, which serve to define the names and desired behaviors of the functions and classes, sometimes including the names of files and parameters, and how exactly the parameters should be passed. But keep in mind not every detail will be captured in the tests! The following requirements will be inspected during manual grading:
say function, your Python solution must be written to accept a single, default, positional argument only.Strive to use the most idiomatic constructs of each language in your solutions.
Generative AI is permitted for this assignment; however, there is no guarantee that it will produce code that meets all of the requirements. Do not try to prompt your way to working solutions. Make sure to thoroughly review and test any code produced by AI tools.
To use the supplied unit tests, you should create a folder called test-data (as a sibling of code and exercises), that contains a single file called test-for-line-count.txt with the following contents:
hello
😁👩🏽🎤 👩🏽🎤🧑🏻🔧 🧑🏻🔧 🧑🏻🔧
# hash1
# hash2 ####
hash is not at the beginning # ⇐⇐⇐ but here
----
last
Run the tests in their corresponding code folders, with the following commands:
lua exercises_test.luanode --test exercises.test.jspython exercises_test.pyIn the file exercises/hw2.md, provide solutions to the following problems. You will need to do research, as not all of these topics were covered in class. For exercises that ask you for prose answers, please be comprehensive and demonstrate a broad understanding. But avoid long-winded, silly gen-ai answers. Expect deductions for verbatim copies of AI slop. Be precise and concise.
3**35 = 50031545098999710 but in Python 3**35 = 50031545098999707. Which one is right and which is wrong? Why? Explain exactly why the right value is right and the wrong value is that particular wrong value.{x: 3, [y]: 5, z}?== operator “equals” (even though people do it all the time)?arithmeticsequence that accepts two arguments, start and delta, that returns a coroutine such that each time it is resumed it yields the next value in the arithmetic sequence starting with start and incrementing by delta.var x = 1
function h() {var x = 9; return g();}
function f() {return x;}
function g() {var x = 3; return f();}
print f() * h() - x
Please use professional and well-structured Markdown formatting for your answers. Take pride in your work. Show you care.
To submit your work, choose one and only one team member to submit to BrightSpace (1) the names of all team members, (2) the URL of your private repository, and (3) an affidavit for each team member stating that they have done the assigned book readings and reviewed the aforementioned course notes pages.
Remember that, when working in teams, all team members should participate in generating solutions and are responsible for understanding all submitted answers. Ideally, each team member should produce individual answers for all exercises, and the team should combine them to produce the ultimate submissions.
You will be graded both on the correctness of your solutions, adherence to each language’s conventions, the following of the assignment instructions, and the cleanliness of the repository. Feedback will be in the form of deductions for such things as:
This list is not exhaustive, but should help in getting you used to paying attention to your submissions and taking pride in your work. Note that most code editors have plugins that will auto-format your code and even look for suspicious coding practices. You are strongly encouraged to use them.
Your homework submission will be the state of your repository on your main branch, at 18:00 in the America/Los Angeles time zone on the due date.